Add hidden event types

This commit is contained in:
Bailey Pumfleet committed 2021-04-28 10:23:30 +01:00
1 parent b32a4c75c0
commit c320b0f20d
5 files changed
+72 -8

No files matched your search

+5 -1
View File
@@ -26,12 +26,14 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const title = req.body.title;
const description = req.body.description;
const length = parseInt(req.body.length);
const hidden = req.body.hidden;
const createEventType = await prisma.eventType.create({
data: {
title: title,
description: description,
length: length,
hidden: hidden,
userId: user.id,
},
});
@@ -56,6 +58,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const title = req.body.title;
const description = req.body.description;
const length = parseInt(req.body.length);
const hidden = req.body.hidden;
const updateEventType = await prisma.eventType.update({
where: {
@@ -64,7 +67,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
data: {
title: title,
description: description,
length: length
length: length,
hidden: hidden
},
});