1
0
mirror of https://github.com/Fayorg/calendrier-avant.git synced 2026-05-27 17:18:38 +02:00

Update grade route.ts to return cookie

This commit is contained in:
timhaller
2023-12-04 10:08:23 +01:00
parent 780a4ada45
commit 4547a5d8e5

View File

@@ -16,7 +16,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
await prisma.grade.findFirst({where: {key: body.key}}).then(async (grade) => {
if (grade) {
await prisma.grade.create({data: {test: 1, grade: body.grade, key: body.key}})
res.status(200).json({message: 'Grade updated'})
res.status(200).json({message: 'Grade updated', cookie: 'voted=true'})
} else {
res.status(404).json({message: 'Key not found'})
}