Skip to content

Commit e5ccd67

Browse files
committed
fix: fiter null values from result (#7951)
1 parent 88297fa commit e5ccd67

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/services/storage/src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,9 @@ export async function createStorage(
17101710
FROM (
17111711
SELECT
17121712
it.id,
1713-
array_agg(tv.destination_target_id) as targets
1713+
array_agg(DISTINCT tv.destination_target_id)
1714+
FILTER (WHERE tv.destination_target_id IS NOT NULL)
1715+
AS "targets"
17141716
FROM targets AS it
17151717
LEFT JOIN target_validation AS tv ON (tv.target_id = it.id)
17161718
WHERE it.id = ${target} AND it.project_id = ${project}
@@ -1786,7 +1788,9 @@ export async function createStorage(
17861788
FROM (
17871789
SELECT
17881790
it.id
1789-
, array_agg(tv.destination_target_id) as targets
1791+
, array_agg(tv.destination_target_id)
1792+
FILTER (WHERE tv.destination_target_id IS NOT NULL)
1793+
AS "targets"
17901794
FROM targets AS it
17911795
LEFT JOIN target_validation AS tv ON (tv.target_id = it.id)
17921796
WHERE

0 commit comments

Comments
 (0)