Migrate the rest of the code.
This commit is contained in:
@@ -53,7 +53,7 @@ pub async fn req(user: User, target: Ref, msg: Ref, edit: Json<Data>) -> Result<
|
||||
}
|
||||
|
||||
let obj = update.as_object_mut().unwrap();
|
||||
obj.insert("embeds".to_string(), json!(new_embeds).0);
|
||||
obj.insert("embeds".to_string(), json!(new_embeds));
|
||||
set.insert("embeds", new_embeds);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ use mongodb::{
|
||||
bson::{doc, from_document},
|
||||
options::FindOptions,
|
||||
};
|
||||
use rocket::form::Form;
|
||||
use rocket::serde::json::Value;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use validator::Validate;
|
||||
@@ -37,7 +36,7 @@ pub struct Options {
|
||||
}
|
||||
|
||||
#[get("/<target>/messages?<options..>")]
|
||||
pub async fn req(user: User, target: Ref, options: Form<Options>) -> Result<Value> {
|
||||
pub async fn req(user: User, target: Ref, options: Options) -> Result<Value> {
|
||||
options
|
||||
.validate()
|
||||
.map_err(|error| Error::FailedValidation { error })?;
|
||||
|
||||
Reference in New Issue
Block a user