Adds Creator's Color to each Content response

This commit is contained in:
2024-08-15 15:36:39 -04:00
parent 536e192ff4
commit 634e79b132
3 changed files with 28 additions and 2 deletions

View File

@@ -30,10 +30,20 @@ public class GetContentsByCreatorHandler(
{
var queryBuilder = new StringBuilder();
queryBuilder.AppendLine($"""
SELECT content."Id", content."CreatedBy", creator."Name" as CreatedByName, i."Logo" as CreatedByPortraitUrl, content."CreatedAt", content."Title", content."Description", content."Urls"
SELECT content."Id",
content."CreatedBy",
creator."Name" as CreatedByName,
i."Logo" as CreatedByPortraitUrl,
c."Menu" as ColorMenu,
c."Accent" as ColorAccent,
content."CreatedAt",
content."Title",
content."Description",
content."Urls"
FROM "Content"."Contents" AS content
INNER JOIN "Content"."Creators" AS creator ON content."CreatedBy" = creator."Id"
LEFT JOIN "Content"."Images" AS i ON creator."Id" = i."CreatorId"
LEFT JOIN "Content"."Colors" AS c ON creator."Id" = c."CreatorId"
WHERE content."CreatedBy" = '{req.CreatorId}'
""");