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>
16 lines
371 B
TypeScript
16 lines
371 B
TypeScript
'use client'
|
|
|
|
import { useEffect } from 'react'
|
|
import { syncActiveSprintCookieAction } from '@/actions/active-sprint'
|
|
|
|
interface Props {
|
|
productId: string
|
|
sprintId: string
|
|
}
|
|
|
|
export function SyncActiveSprintCookie({ productId, sprintId }: Props) {
|
|
useEffect(() => {
|
|
syncActiveSprintCookieAction(productId, sprintId)
|
|
}, [productId, sprintId])
|
|
return null
|
|
}
|