fix: resolve TypeScript build errors from leftJoin nullable types
Some checks failed
Build and Push Backend Image / build (push) Successful in 42s
Build and Push Frontend Image / build (push) Has been cancelled

Non-null assert photo/achievement ids that are structurally non-null
due to FK constraints but nullable in Drizzle's leftJoin return type.
Add missing description field to enrichVideo model select and map.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 19:33:16 +01:00
parent a558449964
commit 90497e9e7c
4 changed files with 24 additions and 6 deletions

View File

@@ -15,8 +15,8 @@ async function enrichModel(db: DB, user: typeof users.$inferSelect) {
const seen = new Set<string>();
const photos = photoRows
.filter((p) => p.id && !seen.has(p.id) && seen.add(p.id))
.map((p) => ({ id: p.id, filename: p.filename }));
.filter((p) => p.id !== null && !seen.has(p.id!) && seen.add(p.id!))
.map((p) => ({ id: p.id!, filename: p.filename! }));
return { ...user, photos };
}