Refactor notifications
This commit is contained in:
@@ -9,7 +9,7 @@ use routes::Page;
|
||||
fn paginated_notifications(conn: DbConn, user: User, page: Page) -> Template {
|
||||
Template::render("notifications/index", json!({
|
||||
"account": user,
|
||||
"notifications": Notification::page_for_user(&*conn, &user, page.limits()),
|
||||
"notifications": Notification::page_for_user(&*conn, &user, page.limits()).into_iter().map(|n| n.to_json(&*conn)).collect::<Vec<_>>(),
|
||||
"page": page.page,
|
||||
"n_pages": Page::total(Notification::find_for_user(&*conn, &user).len() as i32)
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user