diff --git a/PostText.pl b/PostText.pl index 1b38365..025de8c 100755 --- a/PostText.pl +++ b/PostText.pl @@ -115,7 +115,7 @@ group { $c->stash(status => 400) } else { - $c->remark->create_remark( + $c->remark->create( $thread_id, $remark_name, $remark_body diff --git a/lib/PostText/Model/Remark.pm b/lib/PostText/Model/Remark.pm index f589ea4..f10cee1 100644 --- a/lib/PostText/Model/Remark.pm +++ b/lib/PostText/Model/Remark.pm @@ -33,14 +33,10 @@ sub by_page_for($self, $thread_id, $this_page = 1) { END_SQL } -*get_remarks_by_thread_id = \&by_page_for; - sub per_page($self, $value = undef) { $self->{'remarks_per_page'} = $value // $self->{'remarks_per_page'} } -*remarks_per_page = \&per_page; - sub create($self, $thread_id, $author, $body, $hidden = 0, $flagged = 0) { my @data = ($thread_id, $author, $body, $hidden, $flagged); @@ -56,8 +52,6 @@ sub create($self, $thread_id, $author, $body, $hidden = 0, $flagged = 0) { END_SQL } -*create_remark = \&create; - sub count_for($self, $thread_id) { $self->pg->db->query(<<~'END_SQL', $thread_id)->hash->{'count'} SELECT COUNT(*) AS count @@ -67,8 +61,6 @@ sub count_for($self, $thread_id) { END_SQL } -*get_remark_count_by_thread_id = \&count_for; - sub last_page_for($self, $thread_id) { my $remark_count = $self->count_for($thread_id); my $last_page = int($remark_count / $self->{'remarks_per_page'}); @@ -79,8 +71,6 @@ sub last_page_for($self, $thread_id) { $last_page; } -*get_last_page_by_thread_id = \&last_page_for; - sub last_for($self, $thread_id) { my $date_format = $self->{'date_format'}; @@ -96,6 +86,4 @@ sub last_for($self, $thread_id) { END_SQL } -*last_remark = \&last_for; - 1; diff --git a/lib/PostText/Model/Thread.pm b/lib/PostText/Model/Thread.pm index 378d604..57fd949 100644 --- a/lib/PostText/Model/Thread.pm +++ b/lib/PostText/Model/Thread.pm @@ -29,8 +29,6 @@ sub create($self, $author, $title, $body, $hidden = 0, $flagged = 0) { END_SQL } -*create_thread = \&create; - sub dump_all($self) { $self->pg->db->query(<<~'END_SQL', %$self{'date_format'})->hashes SELECT thread_id AS id, @@ -44,8 +42,6 @@ sub dump_all($self) { END_SQL } -*get_all_threads = \&dump_all; - sub by_page($self, $this_page = 1) { my $date_format = %$self{'date_format'}; my $row_count = $self->{'threads_per_page'}; @@ -65,14 +61,10 @@ sub by_page($self, $this_page = 1) { END_SQL } -*get_threads_by_page = \&by_page; - sub per_page($self, $value = undef) { $self->{'threads_per_page'} = $value // $self->{'threads_per_page'} } -*threads_per_page = \&per_page; - sub last_page($self) { my $thread_count = $self->count; my $last_page = int($thread_count / $self->{'threads_per_page'}); @@ -83,8 +75,6 @@ sub last_page($self) { $last_page; } -*get_last_page = \&last_page; - sub count($self) { $self->pg->db->query(<<~'END_SQL')->hash->{'count'} SELECT COUNT(*) AS count @@ -93,8 +83,6 @@ sub count($self) { END_SQL } -*get_thread_count = \&count; - sub by_id($self, $thread_id) { my $date_format = %$self{'date_format'}; @@ -109,6 +97,4 @@ sub by_id($self, $thread_id) { END_SQL } -*get_thread_by_id = \&by_id; - 1;