🐛 (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:
@@ -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 })
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user