Consolidate routing for Remarks

This commit is contained in:
swag 2022-10-12 23:06:26 -04:00
parent 787cfc9bb1
commit f549107dee

View File

@ -84,14 +84,15 @@ sub startup($self) {
->name('bump_thread'); ->name('bump_thread');
# Remark # Remark
my $post_remark = $r->under('/post'); my $remark = $r->under('/remark');
$post_remark
$remark->under('/post')
->any([qw{GET POST}], '/:thread_id', [thread_id => qr/[0-9]+/]) ->any([qw{GET POST}], '/:thread_id', [thread_id => qr/[0-9]+/])
->to('remark#create') ->to('remark#create')
->name('post_remark'); ->name('post_remark');
my $single_remark = $r->under('/remark'); $remark->under('/single')
$single_remark->get('/:remark_id', [remark_id => qr/[0-9]+/]) ->get('/:remark_id', [remark_id => qr/[0-9]+/])
->to('remark#by_id') ->to('remark#by_id')
->name('single_remark'); ->name('single_remark');
} }