fix(seed-forms): always run updateGlobal — fixes re-link on partial state
Remove early-return guard that skipped global linking when both forms already existed. Per-form idempotency is handled by the '?? await payload.create()' pattern, so we can safely always run updateGlobal to ensure forms are linked to their globals even after re-runs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
41593c8edc
commit
0ef399c2f5
1 changed files with 0 additions and 3 deletions
|
|
@ -47,9 +47,6 @@ export async function POST(req: NextRequest): Promise<NextResponse> {
|
|||
limit: 1,
|
||||
overrideAccess: true,
|
||||
})
|
||||
if (existingBirthday.totalDocs >= 1 && existingGroup.totalDocs >= 1) {
|
||||
return NextResponse.json({ message: 'Forms already seeded', count: 2 })
|
||||
}
|
||||
|
||||
// ── 1. Birthday form ──────────────────────────────────────────────
|
||||
const birthdayForm =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue