How to add subroute in a catch-all route
Unanswered
Ankit posted this in #help-forum
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