How to add subroute in a catch-all route
Unanswered
Ankit posted this in #help-forum
![Avatar](https://cdn.discordapp.com/avatars/670306089866231838/0aa45dc73bfa367a27820c63231b7e0a.webp?size=256)
AnkitOP
Examples:
as you can see each hierarchy example will have a starting route as
so how can i achieve route like
where slug might hold
cohorts/:cohortId/:termId/:subjectId/:chapterId/session
cohorts/:cohortId/:subjectId/session
cohorts/:cohortId/:sessionId
cohorts/:cohortId/:termId/:subjectId/:chapterId/assignment
cohorts/:cohortId/:subjectId/assignment
cohorts/:cohortId/assignment
as you can see each hierarchy example will have a starting route as
/cohorts
and ends with either /session
or /assignment
:cohortId
, :termId
, :subjectId
, :chapterId
come based on users selection, so i have turned that into a [...slug] (catch-all) route but now when i create a session and assignment route i get the follwing error Catch-all must be the last part of the URL.so how can i achieve route like
cohorts/[...slug]/[session|assignment]
where slug might hold
cohortId
, termId
, subjectId
or chatperId
and will end with either session or assignment route