Skip to content

getRouterParams : Route Params Key Not Named As The Route Params Name Instead It Name of the Params Name in First Route in the Same Route #988

Closed as not planned
@IqroNegoro

Description

@IqroNegoro

Environment

node v22.12.0

Reproduction

https://codesandbox.io/p/devbox/txr6f6

Describe the bug

assume we have two route with different method but same routes

router.delete(
  "/:delete",
  defineEventHandler((event) => {
    return getRouterParams(event);
  })
);

router.get(
  "/:get",
  defineEventHandler((event) => {
    return getRouterParams(event);
  })
);

if we GET request on /, it should handle by router.get not router.delete, indeed the handler router.get is handle the request, but the key of getRouterParams return delete instead get

{"delete":"test"}

thank you

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingv1wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions