forked from DebaucheryLibrarian/traxxx
Added tags to release channels. Labeling DDF Network VR trailers as VR.
This commit is contained in:
@@ -184,9 +184,18 @@ async function fetchEntitiesBySlug(entitySlugs, sort = 'asc') {
|
||||
FROM entity_tree
|
||||
JOIN entities ON entity_tree.parent_id = entities.id
|
||||
)
|
||||
SELECT jsonb_set(entity, '{children}', to_jsonb(COALESCE(json_agg(children) FILTER (WHERE children.id IS NOT NULL), '[]'))) entity
|
||||
SELECT jsonb_set(
|
||||
jsonb_set(
|
||||
entity,
|
||||
'{children}',
|
||||
to_jsonb(COALESCE(json_agg(children) FILTER (WHERE children.id IS NOT NULL), '[]'))),
|
||||
'{tags}',
|
||||
to_jsonb(COALESCE(json_agg(tags) FILTER (WHERE tags.id IS NOT NULL), '[]'))
|
||||
) entity
|
||||
FROM entity_tree
|
||||
LEFT JOIN entities AS children ON children.parent_id = (entity->>'id')::int
|
||||
LEFT JOIN entities_tags ON entities_tags.entity_id = (entity->>'id')::int
|
||||
LEFT JOIN tags ON tags.id = entities_tags.tag_id
|
||||
WHERE entity_tree.parent_id IS NULL
|
||||
GROUP BY entity_tree.entity
|
||||
ORDER BY entity->'type' :sort;
|
||||
|
||||
Reference in New Issue
Block a user