forked from jmug/stoatchat
Start moving to Rocket 0.5.0
This commit is contained in:
@@ -3,7 +3,7 @@ use crate::util::result::{Error, Result};
|
||||
|
||||
use mongodb::bson::doc;
|
||||
use mongodb::options::FindOneOptions;
|
||||
use rocket_contrib::json::{Json, JsonValue};
|
||||
use rocket::serde::json::{Json, Value};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
@@ -12,7 +12,7 @@ pub struct Options {
|
||||
}
|
||||
|
||||
#[post("/settings/fetch", data = "<options>")]
|
||||
pub async fn req(user: User, options: Json<Options>) -> Result<JsonValue> {
|
||||
pub async fn req(user: User, options: Json<Options>) -> Result<Value> {
|
||||
let options = options.into_inner();
|
||||
let mut projection = doc! {
|
||||
"_id": 0,
|
||||
|
||||
@@ -2,9 +2,9 @@ use crate::database::*;
|
||||
use crate::util::result::Result;
|
||||
|
||||
use mongodb::bson::doc;
|
||||
use rocket_contrib::json::JsonValue;
|
||||
use rocket::serde::json::Value;
|
||||
|
||||
#[get("/unreads")]
|
||||
pub async fn req(user: User) -> Result<JsonValue> {
|
||||
pub async fn req(user: User) -> Result<Value> {
|
||||
Ok(json!(User::fetch_unreads(&user.id).await?))
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ use crate::util::result::{Error, Result};
|
||||
use chrono::prelude::*;
|
||||
use mongodb::bson::{doc, to_bson};
|
||||
use mongodb::options::UpdateOptions;
|
||||
use rocket::request::Form;
|
||||
use rocket_contrib::json::Json;
|
||||
use rocket::form::Form;
|
||||
use rocket::serde::json::Json;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user