feat(admin): show character portrait in editor headers
CI / Verify (push) Successful in 1m0s
CI / Build immutable images and deploy (push) Successful in 2m19s

This commit is contained in:
2026-08-30 05:48:17 +00:00 Unverified
parent 22b09a6136
commit fb4511b1e5
3 changed files with 7 additions and 5 deletions
+3 -2
View File
@@ -64,14 +64,15 @@ export async function listGuideCards(includeTrash = false) {
export async function getGuideByCharacterKey(characterKey: string) {
const [row] = await getDb()
.select({ guide: guides, cover: media })
.select({ guide: guides, cover: media, character: catalogCharacters })
.from(guides)
.innerJoin(media, eq(media.id, guides.coverMediaId))
.innerJoin(catalogCharacters, and(eq(catalogCharacters.version, guides.catalogVersion), eq(catalogCharacters.key, guides.characterKey)))
.where(and(eq(guides.characterKey, characterKey), isNull(guides.trashedAt)))
.limit(1);
if (!row) return null;
const sections = await getDb().select().from(guideSections).where(eq(guideSections.guideId, row.guide.id)).orderBy(asc(guideSections.sortOrder));
return { ...row.guide, coverUrl: publicMediaUrl(row.cover.objectKey), sections };
return { ...row.guide, coverUrl: publicMediaUrl(row.cover.objectKey), character: catalogCharacterWithUrls(row.character), sections };
}
export async function getPublicGuide(slug: string) {