Skip to content

Commit

Permalink
Return empty array instead of null if there aren't ps bookmarks
Browse files Browse the repository at this point in the history
[Re #1611]

* This is a convinience to the FE.
  • Loading branch information
lucassousaf committed Oct 25, 2023
1 parent faa392d commit ed03cb6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions backend/src/gpml/db/topic.clj
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@
entity-name entity-name plastic-strategy-id))
ps-bookmark-select (if-not plastic-strategy-id
""
(format "json_agg(DISTINCT jsonb_build_object('plastic_strategy_id', psb.plastic_strategy_id,
'%s_id', psb.%s_id,
'section_key', psb.section_key))
FILTER (WHERE psb.plastic_strategy_id IS NOT NULL) AS plastic_strategy_bookmarks,"
(format "COALESCE(json_agg(
DISTINCT jsonb_build_object(
'plastic_strategy_id', psb.plastic_strategy_id,
'%s_id', psb.%s_id,
'section_key', psb.section_key))
FILTER (WHERE psb.plastic_strategy_id IS NOT NULL), '[]'::json) AS plastic_strategy_bookmarks,"
entity-name
entity-name))
ps-bookmark-group-by (if-not plastic-strategy-id
Expand Down

0 comments on commit ed03cb6

Please # to comment.