Migrate the rest of the code.

This commit is contained in:
Paul
2021-08-04 10:11:21 +01:00
committed by Paul Makles
parent 9fec4e48c0
commit 382972ea22
12 changed files with 49 additions and 216 deletions

View File

@@ -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 })?;