diff --git a/README.md b/README.md index 6283a75..1011a16 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Run the tests locally (against development environment): ## TODOs 1. Actions for creating moderators and resetting passwords +1. Probably tests for that 'hidden' button 1. CSS 1. "All new posts flagged" mode (require approval for new posts) diff --git a/lib/PostText/Model/Moderator.pm b/lib/PostText/Model/Moderator.pm index 8243503..aac7c44 100644 --- a/lib/PostText/Model/Moderator.pm +++ b/lib/PostText/Model/Moderator.pm @@ -53,14 +53,6 @@ sub unlock($self, $mod_id) { END_SQL } -sub admin_status($self, $mod_id) { - $self->pg->db->query(<<~'END_SQL', $mod_id)->hash->{'admin_status'} - SELECT admin_status - FROM moderators - WHERE moderator_id = ?; - END_SQL -} - sub get_id($self, $email) { $self->pg->db->query(<<~'END_SQL', $email)->hash->{'moderator_id'} SELECT moderator_id @@ -77,6 +69,14 @@ sub get_name($self, $mod_id) { END_SQL } +sub admin_status($self, $mod_id) { + $self->pg->db->query(<<~'END_SQL', $mod_id)->hash->{'admin_status'} + SELECT admin_status + FROM moderators + WHERE moderator_id = ?; + END_SQL +} + sub lock_status($self, $mod_id) { $self->pg->db->query(<<~'END_SQL', $mod_id)->hash->{'lock_status'} SELECT lock_status