Skip to content

Fix: webhook DELETE handler crash — undefined params variable#98

Closed
FuturMix wants to merge 1 commit into
profullstack:masterfrom
FuturMix:fix/webhook-delete-undefined-params
Closed

Fix: webhook DELETE handler crash — undefined params variable#98
FuturMix wants to merge 1 commit into
profullstack:masterfrom
FuturMix:fix/webhook-delete-undefined-params

Conversation

@FuturMix

Copy link
Copy Markdown

Summary

Fixes #97

The DELETE handler in src/app/api/webhooks/[id]/route.js references a bare params variable that doesn't exist in the handler's scope. The withAuth middleware passes Next.js context as event.context, and in Next.js 15 params is a Promise.

Changes

  • src/app/api/webhooks/[id]/route.js: Changed const { id } = paramsconst { id } = (await event.context?.params) || {}

Test plan

  • Send DELETE /api/webhooks/<id> with valid auth — should return 200 instead of crashing
  • Verify the webhook is actually deleted from the database

🤖 Generated with Claude Code

The DELETE handler references a bare `params` variable that is not
defined in scope. The withAuth middleware passes Next.js context as
event.context, so route params must be accessed via
`await event.context.params` (async in Next.js 15).

Without this fix, deleting a webhook always crashes with
ReferenceError: params is not defined.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ralyodio ralyodio closed this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Webhook DELETE handler crashes — undefined params variable

2 participants