mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 13:36:59 +00:00
Update crates to latest version.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use bson::{bson, doc};
|
||||
use bson::doc;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::get_collection;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use super::get_collection;
|
||||
|
||||
use bson::{bson, doc};
|
||||
use bson::doc;
|
||||
use mongodb::options::FindOneOptions;
|
||||
|
||||
/*pub struct MutualGuild {
|
||||
|
||||
@@ -4,7 +4,7 @@ use crate::guards::auth::UserRef;
|
||||
use crate::guards::channel::ChannelRef;
|
||||
use crate::guards::guild::GuildRef;
|
||||
|
||||
use bson::{bson, doc};
|
||||
use bson::doc;
|
||||
use num_enum::TryFromPrimitive;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, TryFromPrimitive)]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use bson::{bson, doc, from_bson, Document};
|
||||
use bson::{doc, from_bson, Document};
|
||||
use mongodb::options::FindOneOptions;
|
||||
use rocket::http::{RawStr, Status};
|
||||
use rocket::request::{self, FromParam, FromRequest, Request};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use bson::{bson, doc, from_bson, Document};
|
||||
use bson::{doc, from_bson, Document};
|
||||
use mongodb::options::FindOneOptions;
|
||||
use rocket::http::RawStr;
|
||||
use rocket::request::FromParam;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use bson::{bson, doc, from_bson, Document};
|
||||
use bson::{doc, from_bson, Document};
|
||||
use mongodb::options::FindOneOptions;
|
||||
use rocket::http::RawStr;
|
||||
use rocket::request::FromParam;
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::database;
|
||||
use crate::email;
|
||||
|
||||
use bcrypt::{hash, verify};
|
||||
use bson::{bson, doc, from_bson, Bson::UtcDatetime};
|
||||
use bson::{doc, from_bson, Bson::UtcDatetime};
|
||||
use chrono::prelude::*;
|
||||
use database::user::User;
|
||||
use rand::{distributions::Alphanumeric, Rng};
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::database::{
|
||||
use crate::guards::auth::UserRef;
|
||||
use crate::guards::channel::ChannelRef;
|
||||
|
||||
use bson::{bson, doc, from_bson, Bson, Bson::UtcDatetime};
|
||||
use bson::{doc, from_bson, Bson, Bson::UtcDatetime};
|
||||
use chrono::prelude::*;
|
||||
use hashbrown::HashSet;
|
||||
use num_enum::TryFromPrimitive;
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::database::{
|
||||
};
|
||||
use crate::guards::auth::UserRef;
|
||||
|
||||
use bson::{bson, doc, from_bson, Bson};
|
||||
use bson::{doc, from_bson, Bson};
|
||||
use rocket_contrib::json::Json;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use ulid::Ulid;
|
||||
@@ -125,15 +125,18 @@ pub fn create_guild(user: UserRef, info: Json<CreateGuild>) -> Response {
|
||||
|
||||
let id = Ulid::new().to_string();
|
||||
let channel_id = Ulid::new().to_string();
|
||||
if channels.insert_one(
|
||||
doc! {
|
||||
"_id": channel_id.clone(),
|
||||
"type": ChannelType::GUILDCHANNEL as u32,
|
||||
"name": "general",
|
||||
"guild": id.clone(),
|
||||
},
|
||||
None,
|
||||
).is_err() {
|
||||
if channels
|
||||
.insert_one(
|
||||
doc! {
|
||||
"_id": channel_id.clone(),
|
||||
"type": ChannelType::GUILDCHANNEL as u32,
|
||||
"name": "general",
|
||||
"guild": id.clone(),
|
||||
},
|
||||
None,
|
||||
)
|
||||
.is_err()
|
||||
{
|
||||
return Response::InternalServerError(
|
||||
json!({ "error": "Failed to create guild channel." }),
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@ use crate::database::{get_relationship, get_relationship_internal, Relationship}
|
||||
use crate::guards::auth::UserRef;
|
||||
use crate::routes::channel;
|
||||
|
||||
use bson::{bson, doc, from_bson};
|
||||
use bson::{doc, from_bson};
|
||||
use mongodb::options::FindOptions;
|
||||
use rocket_contrib::json::Json;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -6,7 +6,7 @@ use hashbrown::HashMap;
|
||||
use std::sync::RwLock;
|
||||
use ulid::Ulid;
|
||||
|
||||
use bson::{bson, doc};
|
||||
use bson::doc;
|
||||
use serde_json::{from_str, json, Value};
|
||||
|
||||
use ws::{listen, CloseCode, Error, Handler, Handshake, Message, Result, Sender};
|
||||
|
||||
Reference in New Issue
Block a user