forked from jmug/stoatchat
chore(monorepo): delta, january, quark
This commit is contained in:
15
crates/delta/src/routes/sync/get_unreads.rs
Normal file
15
crates/delta/src/routes/sync/get_unreads.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use revolt_quark::{
|
||||
models::{ChannelUnread, User},
|
||||
Db, Result,
|
||||
};
|
||||
|
||||
use rocket::serde::json::Json;
|
||||
|
||||
/// # Fetch Unreads
|
||||
///
|
||||
/// Fetch information about unread state on channels.
|
||||
#[openapi(tag = "Sync")]
|
||||
#[get("/unreads")]
|
||||
pub async fn req(db: &Db, user: User) -> Result<Json<Vec<ChannelUnread>>> {
|
||||
db.fetch_unreads(&user.id).await.map(Json)
|
||||
}
|
||||
Reference in New Issue
Block a user