feat(specials): add launch and end dates for scheduling
This commit is contained in:
@@ -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,
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user