From b6853882899fa45098acc1dd35e9792bd234e603 Mon Sep 17 00:00:00 2001 From: swag Date: Mon, 9 Jan 2023 19:50:54 -0500 Subject: [PATCH] Move this to somewhat organize --- README.md | 1 + lib/PostText/Model/Moderator.pm | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) 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