Skip to content

Bug: Webhook DELETE handler crashes — undefined params variable #97

@FuturMix

Description

@FuturMix

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

  1. Authenticate and send DELETE /api/webhooks/<webhook-id>
  2. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions