forked from jmug/stoatchat
Basic Web Push support.
This commit is contained in:
@@ -2,8 +2,8 @@ use crate::database::*;
|
||||
use crate::util::result::{Error, Result};
|
||||
|
||||
use futures::StreamExt;
|
||||
use mongodb::bson::{doc, Document};
|
||||
use mongodb::options::FindOptions;
|
||||
use mongodb::bson::{Document, doc};
|
||||
use rocket_contrib::json::JsonValue;
|
||||
|
||||
#[get("/<target>/mutual")]
|
||||
@@ -19,9 +19,7 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
|
||||
{ "recipients": &target.id }
|
||||
]
|
||||
},
|
||||
FindOptions::builder()
|
||||
.projection(doc! { "_id": 1 })
|
||||
.build()
|
||||
FindOptions::builder().projection(doc! { "_id": 1 }).build(),
|
||||
)
|
||||
.await
|
||||
.map_err(|_| Error::DatabaseError {
|
||||
@@ -35,7 +33,5 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
|
||||
.filter_map(|x| x.get_str("_id").ok().map(|x| x.to_string()))
|
||||
.collect::<Vec<String>>();
|
||||
|
||||
Ok(json!({
|
||||
"channels": channels
|
||||
}))
|
||||
Ok(json!({ "channels": channels }))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user