mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 16:35:17 +00:00
Update get_admin_info route
This commit is contained in:
@ -24,6 +24,14 @@ pub fn create(new_admin: &NewAdmin) -> Res<AdminID> {
|
||||
.map(|i| AdminID::new(i))
|
||||
}
|
||||
|
||||
/// Check out whether an admin exists or not
|
||||
pub fn exists(id: AdminID) -> Res<bool> {
|
||||
database::QueryInfo::new(ADMIN_LIST_TABLE)
|
||||
.cond_admin_id("id", id)
|
||||
.exec_count()
|
||||
.map(|r| r > 0)
|
||||
}
|
||||
|
||||
/// Get admin information by ID
|
||||
pub fn find_admin_by_id(id: AdminID) -> Res<Admin> {
|
||||
database::QueryInfo::new(ADMIN_LIST_TABLE)
|
||||
|
Reference in New Issue
Block a user