forked from jmug/stoatchat
feat(servers): implement create, delete, edit, fetch
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
use revolt_quark::{Result, models::{UserSettings, User}, Db};
|
||||
use revolt_quark::{
|
||||
models::{User, UserSettings},
|
||||
Db, Result,
|
||||
};
|
||||
|
||||
use mongodb::bson::doc;
|
||||
use rocket::serde::json::Json;
|
||||
@@ -11,5 +14,7 @@ pub struct Options {
|
||||
|
||||
#[post("/settings/fetch", data = "<options>")]
|
||||
pub async fn req(db: &Db, user: User, options: Json<Options>) -> Result<Json<UserSettings>> {
|
||||
db.fetch_user_settings(&user.id, &options.into_inner().keys).await.map(Json)
|
||||
db.fetch_user_settings(&user.id, &options.into_inner().keys)
|
||||
.await
|
||||
.map(Json)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user