mirror of
https://github.com/house-of-vanity/OutFleet.git
synced 2025-10-26 10:09:08 +00:00
Made subs
This commit is contained in:
@@ -168,6 +168,16 @@ impl UserRepository {
|
||||
.await?;
|
||||
Ok(admins)
|
||||
}
|
||||
|
||||
/// Get the first admin user (for system operations)
|
||||
pub async fn get_first_admin(&self) -> Result<Option<Model>> {
|
||||
let admin = User::find()
|
||||
.filter(Column::IsTelegramAdmin.eq(true))
|
||||
.one(&self.db)
|
||||
.await?;
|
||||
|
||||
Ok(admin)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user