Files
handmade-revolt-backend/src/routes/sync/get_unreads.rs
Paul 06f968022d Update to rAuth v1, closes #63.
Add Pong packet for normal frames.
2021-09-11 11:23:15 +01:00

15 lines
314 B
Rust

use crate::database::*;
use crate::util::result::{Error, Result};
use mongodb::bson::doc;
use rocket::serde::json::Value;
#[get("/unreads")]
pub async fn req(user: User) -> Result<Value> {
if user.bot.is_some() {
return Err(Error::IsBot);
}
Ok(json!(User::fetch_unreads(&user.id).await?))
}