2
0

🐛 (webhook) Fix record to update not found

Still not sure why it's happenning but it might be better to omit ids from the updates body.
This commit is contained in:
Baptiste Arnaud
2023-02-18 17:26:57 +01:00
parent 0831dcf72a
commit c32aadc95b

View File

@@ -10,6 +10,7 @@ import {
notFound, notFound,
} from 'utils/api' } from 'utils/api'
import { getTypebot } from '@/features/typebot/api/utils/getTypebot' import { getTypebot } from '@/features/typebot/api/utils/getTypebot'
import { omit } from 'utils'
const handler = async (req: NextApiRequest, res: NextApiResponse) => { const handler = async (req: NextApiRequest, res: NextApiResponse) => {
const user = await getAuthenticatedUser(req) const user = await getAuthenticatedUser(req)
@@ -44,7 +45,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
where: { where: {
id: webhookId, id: webhookId,
}, },
data, data: omit(data, 'id', 'typebotId'),
}) })
return res.send({ webhook }) return res.send({ webhook })
} }