show notification badge in menu
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use crate::model::{
|
||||
role::Role,
|
||||
user::{SchnupperBetreuerUser, User, UserWithRoles},
|
||||
user::{SchnupperBetreuerUser, User, UserWithRolesAndNotificationCount},
|
||||
};
|
||||
use futures::future::join_all;
|
||||
use rocket::{
|
||||
@ -38,9 +38,9 @@ async fn index(
|
||||
let user_futures: Vec<_> = User::all_with_role(db, &schnupperant)
|
||||
.await
|
||||
.into_iter()
|
||||
.map(|u| async move { UserWithRoles::from_user(u, db).await })
|
||||
.map(|u| async move { UserWithRolesAndNotificationCount::from_user(u, db).await })
|
||||
.collect();
|
||||
let users: Vec<UserWithRoles> = join_all(user_futures).await;
|
||||
let users: Vec<UserWithRolesAndNotificationCount> = join_all(user_futures).await;
|
||||
|
||||
let mut context = Context::new();
|
||||
if let Some(msg) = flash {
|
||||
@ -49,7 +49,7 @@ async fn index(
|
||||
context.insert("schnupperanten", &users);
|
||||
context.insert(
|
||||
"loggedin_user",
|
||||
&UserWithRoles::from_user(user.into(), db).await,
|
||||
&UserWithRolesAndNotificationCount::from_user(user.into(), db).await,
|
||||
);
|
||||
|
||||
Template::render("admin/schnupper/index", context.into_json())
|
||||
|
Reference in New Issue
Block a user