fix(viewer): 🐛 Result creation fail
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { withSentry } from '@sentry/nextjs'
|
||||
import prisma from 'libs/prisma'
|
||||
import { Result } from 'models'
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { methodNotAllowed } from 'utils'
|
||||
|
||||
@ -7,7 +8,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method === 'PATCH') {
|
||||
const data = (
|
||||
typeof req.body === 'string' ? JSON.parse(req.body) : req.body
|
||||
) as { isCompleted: true }
|
||||
) as Result
|
||||
const resultId = req.query.resultId as string
|
||||
const result = await prisma.result.update({
|
||||
where: { id: resultId },
|
||||
|
Reference in New Issue
Block a user