fix: cookie-write uit Server Component (Next.js 16 verbiedt dit)
setActiveSprintCookie werd direct aangeroepen in app/(app)/products/[id]/sprint/[sprintId]/page.tsx,
wat in Next.js 16 een runtime-error oplevert ('Cookies can only be modified in a Server Action
or Route Handler'). Vervangen door een client-side bridge die syncActiveSprintCookieAction
aanroept na mount, zodat de active-sprint cookie nog steeds gesynced blijft met de URL.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1a5c0b2d01
commit
b4aa5d9949
3 changed files with 39 additions and 3 deletions
|
|
@ -4,8 +4,8 @@ import { getSession } from '@/lib/auth'
|
|||
import { getAccessibleProduct } from '@/lib/product-access'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
import { pbiStatusToApi } from '@/lib/task-status'
|
||||
import { setActiveSprintCookie } from '@/lib/active-sprint'
|
||||
import { SprintBoardClient } from '@/components/sprint/sprint-board-client'
|
||||
import { SyncActiveSprintCookie } from '@/components/sprint/sync-active-sprint-cookie'
|
||||
import { SprintHeader } from '@/components/sprint/sprint-header'
|
||||
import { SprintRunControls } from '@/components/sprint/sprint-run-controls'
|
||||
import { parsePauseContext } from '@/lib/pause-context'
|
||||
|
|
@ -48,8 +48,6 @@ export default async function SprintBoardPage({ params, searchParams }: Props) {
|
|||
})
|
||||
if (!sprint) notFound()
|
||||
|
||||
await setActiveSprintCookie(id, sprint.id)
|
||||
|
||||
const activeSprintRun = await prisma.sprintRun.findFirst({
|
||||
where: {
|
||||
sprint_id: sprint.id,
|
||||
|
|
@ -158,6 +156,7 @@ export default async function SprintBoardPage({ params, searchParams }: Props) {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col h-full">
|
||||
<SyncActiveSprintCookie productId={id} sprintId={sprint.id} />
|
||||
<SprintHeader
|
||||
productId={id}
|
||||
productName={product.name}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue