fix(PBI-59): drop invalid Sprint.code select in fetchJobsPageData (#151)

Sprint heeft geen `code` veld; de query crashte met
PrismaClientValidationError zodra /jobs werd geopend. sprintCode blijft
in JobWithRelations als string|null voor UI-compat (JobCard.titleText
fallback) maar is nu altijd null.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-05-07 19:24:21 +02:00 committed by GitHub
parent f166186374
commit a7e9ca1c35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,7 +35,7 @@ const JOB_INCLUDE = {
task: { select: { code: true, title: true } }, task: { select: { code: true, title: true } },
idea: { select: { code: true, title: true } }, idea: { select: { code: true, title: true } },
product: { select: { name: true } }, product: { select: { name: true } },
sprint_run: { include: { sprint: { select: { sprint_goal: true, code: true } } } }, sprint_run: { include: { sprint: { select: { sprint_goal: true } } } },
} as const } as const
function mapJob(j: { function mapJob(j: {
@ -59,7 +59,7 @@ function mapJob(j: {
task: { code: string | null; title: string } | null task: { code: string | null; title: string } | null
idea: { code: string | null; title: string } | null idea: { code: string | null; title: string } | null
product: { name: string } product: { name: string }
sprint_run: { sprint: { sprint_goal: string; code: string | null } } | null sprint_run: { sprint: { sprint_goal: string } } | null
}): JobWithRelations { }): JobWithRelations {
return { return {
id: j.id, id: j.id,
@ -70,7 +70,7 @@ function mapJob(j: {
ideaCode: j.idea?.code ?? null, ideaCode: j.idea?.code ?? null,
ideaTitle: j.idea?.title ?? null, ideaTitle: j.idea?.title ?? null,
sprintGoal: j.sprint_run?.sprint.sprint_goal ?? null, sprintGoal: j.sprint_run?.sprint.sprint_goal ?? null,
sprintCode: j.sprint_run?.sprint.code ?? null, sprintCode: null,
productName: j.product.name, productName: j.product.name,
modelId: j.model_id, modelId: j.model_id,
inputTokens: j.input_tokens, inputTokens: j.input_tokens,