diff --git a/lib/guides/queries.ts b/lib/guides/queries.ts index e2c6055..b843c3a 100644 --- a/lib/guides/queries.ts +++ b/lib/guides/queries.ts @@ -335,6 +335,7 @@ async function populatedSections(guideId: string) { or exists (select 1 from jsonb_array_elements(p.target_conditions) c where c->'rows' <> '[]'::jsonb))) when 'constellations' then exists (select 1 from ${constellationRecommendations} r join ${constellationConditions} c on c.id = r.condition_id where c.guide_id = ${guideId}) when 'team' then exists (select 1 from ${teamCompositions} t where t.guide_id = ${guideId}) + when 'extra' then true else exists (select 1 from ${extraSectionRows} r where r.section_id = ${guideSections.id}) end`, }).from(guideSections).where(and( eq(guideSections.guideId, guideId),