2018-05-13 15:35:55 +02:00
|
|
|
use rocket_contrib::Template;
|
|
|
|
|
|
|
|
use db_conn::DbConn;
|
2018-05-19 09:39:59 +02:00
|
|
|
use models::{notifications::Notification, users::User};
|
2018-05-13 15:35:55 +02:00
|
|
|
|
|
|
|
#[get("/notifications")]
|
|
|
|
fn notifications(conn: DbConn, user: User) -> Template {
|
|
|
|
Template::render("notifications/index", json!({
|
|
|
|
"account": user,
|
|
|
|
"notifications": Notification::find_for_user(&*conn, &user)
|
|
|
|
}))
|
|
|
|
}
|