Fix totalCount 5xx
Signed-off-by: Bryan Frimin <bryan@getprobo.com> Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
committed by
Sacha Al Himdani
parent
87b99ea912
commit
1f94ddba95
@@ -68,7 +68,8 @@ func (c *Controls) CountByDocumentID(
|
|||||||
q := `
|
q := `
|
||||||
WITH ctrl AS (
|
WITH ctrl AS (
|
||||||
SELECT
|
SELECT
|
||||||
c.id
|
c.id,
|
||||||
|
c.tenant_id
|
||||||
FROM
|
FROM
|
||||||
controls c
|
controls c
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
@@ -173,7 +174,8 @@ func (c *Controls) CountByMeasureID(
|
|||||||
q := `
|
q := `
|
||||||
WITH ctrl AS (
|
WITH ctrl AS (
|
||||||
SELECT
|
SELECT
|
||||||
c.id
|
c.id,
|
||||||
|
c.tenant_id
|
||||||
FROM
|
FROM
|
||||||
controls c
|
controls c
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
@@ -278,7 +280,8 @@ func (c *Controls) CountByRiskID(
|
|||||||
q := `
|
q := `
|
||||||
WITH ctrl AS (
|
WITH ctrl AS (
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
c.id
|
c.id,
|
||||||
|
c.tenant_id
|
||||||
FROM
|
FROM
|
||||||
controls c
|
controls c
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
@@ -475,7 +478,8 @@ func (c *Controls) CountByOrganizationID(
|
|||||||
q := `
|
q := `
|
||||||
WITH ctrl AS (
|
WITH ctrl AS (
|
||||||
SELECT
|
SELECT
|
||||||
c.id
|
c.id,
|
||||||
|
c.tenant_id
|
||||||
FROM
|
FROM
|
||||||
controls c
|
controls c
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
@@ -491,6 +495,8 @@ WHERE %s
|
|||||||
AND %s
|
AND %s
|
||||||
`
|
`
|
||||||
|
|
||||||
|
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment())
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
maps.Copy(args, filter.SQLArguments())
|
maps.Copy(args, filter.SQLArguments())
|
||||||
|
|||||||
@@ -289,7 +289,8 @@ func (p *Documents) CountByControlID(
|
|||||||
q := `
|
q := `
|
||||||
WITH plcs AS (
|
WITH plcs AS (
|
||||||
SELECT
|
SELECT
|
||||||
p.id
|
p.id,
|
||||||
|
p.tenant_id
|
||||||
FROM
|
FROM
|
||||||
documents p
|
documents p
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
|
|||||||
Reference in New Issue
Block a user