Fix bug with subforum routes

Subforum-related routes have been repositioned to the bottom of the
routes list, as putting them above other routes would make them
"override" the routes below. i.e. `/logout` would be treated as though
you were trying to view a subforum named `logout`
This commit is contained in:
ngoomie 2024-08-19 21:41:58 -06:00
parent 35e7648226
commit f10dab805a
1 changed files with 18 additions and 16 deletions

View File

@ -74,21 +74,6 @@ sub startup {
controller => 'Controller::Index', controller => 'Controller::Index',
action => 'index' action => 'index'
); );
# view subforum
$r->get('/:id')->to(
controller => 'Controller::ViewSubf',
action => 'subf_view'
);
# create thread
$r->get('/:id/new')->to(
controller => 'Controller::NewThread',
action => 'thread_compose'
);
$r->post('/:id/new')->to(
controller => 'Controller::NewThread',
action => 'thread_submit'
);
## registration page ## registration page
$r->get('/register')->to( $r->get('/register')->to(
@ -114,7 +99,24 @@ sub startup {
$r->get('/logout')->to( $r->get('/logout')->to(
controller => 'Controller::Logout', controller => 'Controller::Logout',
action => 'logout_do' action => 'logout_do'
) );
# view subforum
# NOTE: keep these at THE BOTTOM of routes, otherwise they override the above routes.
$r->get('/:id')->to(
controller => 'Controller::ViewSubf',
action => 'subf_view'
);
# create thread
$r->get('/:id/new')->to(
controller => 'Controller::NewThread',
action => 'thread_compose'
);
$r->post('/:id/new')->to(
controller => 'Controller::NewThread',
action => 'thread_submit'
);
} }
1; 1;