feat(specials): add curator field

This commit is contained in:
Hördle Bot
2025-11-23 02:25:45 +01:00
parent 6fd5f8ed0c
commit 2a38bce02c
6 changed files with 41 additions and 14 deletions

View File

@@ -16,7 +16,7 @@ export async function GET() {
}
export async function POST(request: Request) {
const { name, maxAttempts = 7, unlockSteps = '[2,4,7,11,16,30,60]', launchDate, endDate } = await request.json();
const { name, maxAttempts = 7, unlockSteps = '[2,4,7,11,16,30,60]', launchDate, endDate, curator } = await request.json();
if (!name) {
return NextResponse.json({ error: 'Name is required' }, { status: 400 });
}
@@ -27,6 +27,7 @@ export async function POST(request: Request) {
unlockSteps,
launchDate: launchDate ? new Date(launchDate) : null,
endDate: endDate ? new Date(endDate) : null,
curator: curator || null,
},
});
return NextResponse.json(special);
@@ -42,7 +43,7 @@ export async function DELETE(request: Request) {
}
export async function PUT(request: Request) {
const { id, name, maxAttempts, unlockSteps, launchDate, endDate } = await request.json();
const { id, name, maxAttempts, unlockSteps, launchDate, endDate, curator } = await request.json();
if (!id) {
return NextResponse.json({ error: 'ID required' }, { status: 400 });
}
@@ -54,6 +55,7 @@ export async function PUT(request: Request) {
...(unlockSteps && { unlockSteps }),
launchDate: launchDate ? new Date(launchDate) : null,
endDate: endDate ? new Date(endDate) : null,
curator: curator || null,
},
});
return NextResponse.json(updated);