You've already forked AstralRinth
forked from didirus/AstralRinth
More APIv2 Fixes (#210)
* Refactor search to not spam the database with queries, new utility routes for V2 * Run prepare * More V2 Fixes * Run prepare + formatter
This commit is contained in:
@@ -478,13 +478,15 @@ pub async fn user_notifications(
|
||||
));
|
||||
}
|
||||
|
||||
let notifications: Vec<Notification> =
|
||||
let mut notifications: Vec<Notification> =
|
||||
crate::database::models::notification_item::Notification::get_many_user(id, &**pool)
|
||||
.await?
|
||||
.into_iter()
|
||||
.map(convert_notification)
|
||||
.collect();
|
||||
|
||||
notifications.sort_by(|a, b| b.created.cmp(&a.created));
|
||||
|
||||
Ok(HttpResponse::Ok().json(notifications))
|
||||
} else {
|
||||
Ok(HttpResponse::NotFound().body(""))
|
||||
|
||||
Reference in New Issue
Block a user