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
1 changed files with 1 additions and 1 deletions

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'})
}