Summary
The DELETE handler in src/app/api/webhooks/[id]/route.js references a bare params variable (line 7) that doesn't exist in scope. The withAuth wrapper passes Next.js route context as event.context, so the dynamic [id] parameter must be accessed via event.context.params.
Impact
Deleting a webhook always crashes with ReferenceError: params is not defined, returning a 500 error.
Steps to Reproduce
- Authenticate and send
DELETE /api/webhooks/<webhook-id>
- Server crashes with
ReferenceError: params is not defined
Fix
Change const { id } = params to const { id } = (await event.context?.params) || {} (Next.js 15 makes params async).
Summary
The
DELETEhandler insrc/app/api/webhooks/[id]/route.jsreferences a bareparamsvariable (line 7) that doesn't exist in scope. ThewithAuthwrapper passes Next.js route context asevent.context, so the dynamic[id]parameter must be accessed viaevent.context.params.Impact
Deleting a webhook always crashes with
ReferenceError: params is not defined, returning a 500 error.Steps to Reproduce
DELETE /api/webhooks/<webhook-id>ReferenceError: params is not definedFix
Change
const { id } = paramstoconst { id } = (await event.context?.params) || {}(Next.js 15 makes params async).