You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The EXISTS arm prevents the default sibling from joining when the group
144
-
// has an exact entry-locale row, so every assignment contributes at most one term.
145
-
constterms=sql`(SELECT ${agg(termObj)} FROM ${sql.ref("content_taxonomies")} AS ct ${foldJoin}${sql.ref("taxonomies")} AS t ON t.translation_group = ct.taxonomy_id AND t.locale = CASE WHEN EXISTS (SELECT 1 FROM ${sql.ref("taxonomies")} AS exact_term WHERE exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = ${o}.locale) THEN ${o}.locale ELSE ${defaultLocale} END WHERE ct.collection = ${type} AND ct.entry_id = ${o}.translation_group) AS ${sql.ref("_emdash_terms")}`;
? sql`coalesce(json_agg(${termObj}) FILTER (WHERE ${selectedTermId} IS NOT NULL), '[]'::json)`
141
+
: sql`json_group_array(${termObj}) FILTER (WHERE ${selectedTermId} IS NOT NULL)`;
142
+
constterms=sql`(SELECT ${termAgg} FROM ${sql.ref("content_taxonomies")} AS ct LEFT JOIN ${sql.ref("taxonomies")} AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = ${o}.locale LEFT JOIN ${sql.ref("taxonomies")} AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ${defaultLocale} WHERE ct.collection = ${type} AND ct.entry_id = ${o}.translation_group) AS ${sql.ref("_emdash_terms")}`;
0 commit comments