From f549107dee2a271c1b64230ca6e21936ea45bd33 Mon Sep 17 00:00:00 2001 From: swag Date: Wed, 12 Oct 2022 23:06:26 -0400 Subject: [PATCH] Consolidate routing for Remarks --- lib/PostText.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/PostText.pm b/lib/PostText.pm index 1d35021..80b9452 100644 --- a/lib/PostText.pm +++ b/lib/PostText.pm @@ -84,14 +84,15 @@ sub startup($self) { ->name('bump_thread'); # Remark - my $post_remark = $r->under('/post'); - $post_remark + my $remark = $r->under('/remark'); + + $remark->under('/post') ->any([qw{GET POST}], '/:thread_id', [thread_id => qr/[0-9]+/]) ->to('remark#create') ->name('post_remark'); - my $single_remark = $r->under('/remark'); - $single_remark->get('/:remark_id', [remark_id => qr/[0-9]+/]) + $remark->under('/single') + ->get('/:remark_id', [remark_id => qr/[0-9]+/]) ->to('remark#by_id') ->name('single_remark'); }