Made subs

This commit is contained in:
AB from home.homenet
2025-10-19 05:06:38 +03:00
parent d972f10f83
commit d80ac56b83
11 changed files with 585 additions and 50 deletions

View File

@@ -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)]