aboutsummaryrefslogtreecommitdiff
path: root/logic/src/admin/user.rs
diff options
context:
space:
mode:
Diffstat (limited to 'logic/src/admin/user.rs')
-rw-r--r--logic/src/admin/user.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/logic/src/admin/user.rs b/logic/src/admin/user.rs
new file mode 100644
index 0000000..2d788cb
--- /dev/null
+++ b/logic/src/admin/user.rs
@@ -0,0 +1,17 @@
+/*
+ This file is part of jellything (https://codeberg.org/metamuffin/jellything)
+ which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
+ Copyright (C) 2025 metamuffin <metamuffin.org>
+*/
+
+use crate::session::AdminSession;
+use anyhow::Result;
+use jellybase::database::Database;
+use jellycommon::api::ApiAdminUsersResponse;
+
+pub fn admin_users(db: &Database, _session: &AdminSession) -> Result<ApiAdminUsersResponse> {
+ // TODO dont return useless info like passwords
+ Ok(ApiAdminUsersResponse {
+ users: db.list_users()?,
+ })
+}