-
I have the following situation: I have two controllers, one for Competition, one for CompetitionRound (one competition can have many rounds) I have the following routes: GET /competition -> CompetitionsController.index GET /competition-round -> CompetitionRoundsController.index Now, the index of CompetitionRoundsController accepts a query-string parameter for I want the same index method to be accessible via Is there anyway to forward |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
You can create the route normally in router.method("/competition-round") and in the handler's ctx search for .qs() See the documentation: |
Beta Was this translation helpful? Give feedback.
Define route for the path containing the param, then read the params and redirect it using the query string.
https://docs.adonisjs.com/guides/response#redirects