Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixing specific and generic route params #106

Closed
masawik opened this issue Jun 5, 2024 · 1 comment
Closed

Mixing specific and generic route params #106

masawik opened this issue Jun 5, 2024 · 1 comment

Comments

@masawik
Copy link

masawik commented Jun 5, 2024

Environment

"radix3": "1.1.2"

Reproduction

https://stackblitz.com/edit/stackblitz-starters-awjduj?file=index.js

Describe the bug

i have route with generic entity handler
/api/:entity/:id
and route with specific entity id handler
/api/:entity/123

and it works well

but when route handler for specific entity present in router
/api/posts/:id/comments

router.lookup no longer returns generic route for this entity by paths like this /api/posts/312

it just returns nothing because in lookup function it sees static node by section name and tries to find route only inside this node

Additional context

image

Logs

No response

@pi0
Copy link
Member

pi0 commented Jul 4, 2024

Thanks for report and reproduction. I have made a rewrite of this library in #107 and next version will correctly handle this.

Updated sandbox with rou3: https://stackblitz.com/edit/stackblitz-starters-6na6gb?file=index.js

@pi0 pi0 closed this as completed Jul 4, 2024
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

No branches or pull requests

2 participants