feat(specials): add launch and end dates for scheduling

This commit is contained in:
Hördle Bot
2025-11-23 02:09:49 +01:00
parent 69eb69b8cd
commit e9526918e1
7 changed files with 160 additions and 26 deletions

View File

@@ -43,14 +43,16 @@ export async function PUT(
try {
const { id } = await params;
const specialId = parseInt(id);
const { name, maxAttempts, unlockSteps } = await request.json();
const { name, maxAttempts, unlockSteps, launchDate, endDate } = await request.json();
const special = await prisma.special.update({
where: { id: specialId },
data: {
name,
maxAttempts,
unlockSteps: JSON.stringify(unlockSteps)
unlockSteps: typeof unlockSteps === 'string' ? unlockSteps : JSON.stringify(unlockSteps),
launchDate: launchDate ? new Date(launchDate) : null,
endDate: endDate ? new Date(endDate) : null,
}
});