force an action on important notifications
Some checks failed
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled

This commit is contained in:
2026-01-03 22:11:11 +01:00
parent fe0761a4c8
commit 0ccd59f8a7
3 changed files with 34 additions and 0 deletions

View File

@@ -88,17 +88,20 @@ pub struct UserWithDetails {
pub allowed_to_steer: bool,
pub on_water: bool,
pub roles: Vec<String>,
pub action_notification: Option<Notification>,
}
impl UserWithDetails {
pub async fn from_user(user: User, db: &SqlitePool) -> Self {
let allowed_to_steer = user.allowed_to_steer(db).await;
let action_notification = Notification::oldest_unread_with_action(db, user.id).await;
Self {
on_water: user.on_water(db).await,
roles: user.roles(db).await,
amount_unread_notifications: user.amount_unread_notifications(db).await,
allowed_to_steer,
action_notification,
user,
}
}