mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-07-10 01:22:48 +00:00
Can remove a key from the list of keys of an admin
This commit is contained in:
@ -27,6 +27,13 @@ pub fn get_admin_keys(id: AdminID) -> Res<Vec<AdminKey>> {
|
||||
.exec(db_to_admin_key)
|
||||
}
|
||||
|
||||
/// Remove a key from the database
|
||||
pub fn delete_key(key: AdminKey) -> Res {
|
||||
database::DeleteQuery::new(ADMIN_KEYS_TABLE)
|
||||
.cond_u64("id", key.id)
|
||||
.exec()
|
||||
}
|
||||
|
||||
/// Turn database entry into an AdminKey structure
|
||||
fn db_to_admin_key(row: &database::RowResult) -> Res<AdminKey> {
|
||||
Ok(AdminKey {
|
||||
|
Reference in New Issue
Block a user