diff --git a/lib/PostText/Model/Remark.pm b/lib/PostText/Model/Remark.pm index 6976a74..7f06cfb 100644 --- a/lib/PostText/Model/Remark.pm +++ b/lib/PostText/Model/Remark.pm @@ -33,4 +33,26 @@ sub remarks_per_page($self, $value = undef) { $self->{'remarks_per_page'} = $value // $self->{'remarks_per_page'}; } +sub create_remark( + $self, + $thread_id, + $author, + $body, + $hidden = 0, + $flagged = 0 + ) +{ + $self->pg->db + ->query(<<~'END_SQL', $thread_id, $author, $body, $hidden, $flagged) + INSERT INTO remarks ( + thread_id, + remark_author, + remark_body, + hidden_status, + flagged_status + ) + VALUES (?, ?, ?, ?, ?); + END_SQL +} + 1;