mirror of
https://github.com/house-of-vanity/OutFleet.git
synced 2025-10-26 10:09:08 +00:00
TG almost works
This commit is contained in:
@@ -126,15 +126,6 @@ impl UserRepository {
|
||||
Ok(count > 0)
|
||||
}
|
||||
|
||||
/// Get all Telegram admins
|
||||
pub async fn get_telegram_admins(&self) -> Result<Vec<Model>> {
|
||||
let admins = User::find()
|
||||
.filter(Column::IsTelegramAdmin.eq(true))
|
||||
.order_by_desc(Column::CreatedAt)
|
||||
.all(&self.db)
|
||||
.await?;
|
||||
Ok(admins)
|
||||
}
|
||||
|
||||
/// Set user as Telegram admin
|
||||
pub async fn set_telegram_admin(&self, user_id: Uuid, is_admin: bool) -> Result<Option<Model>> {
|
||||
@@ -167,6 +158,16 @@ impl UserRepository {
|
||||
Ok(false)
|
||||
}
|
||||
}
|
||||
|
||||
/// Get all Telegram admins
|
||||
pub async fn get_telegram_admins(&self) -> Result<Vec<Model>> {
|
||||
let admins = User::find()
|
||||
.filter(Column::IsTelegramAdmin.eq(true))
|
||||
.filter(Column::TelegramId.is_not_null())
|
||||
.all(&self.db)
|
||||
.await?;
|
||||
Ok(admins)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user