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

Open
@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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions