feat: implement channel invites, perms, group create, members fetch
chore: when you accidentally run fmt
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use revolt_quark::{Error, EmptyResponse, Result, models::User, Database};
|
||||
use crate::util::regex::RE_USERNAME;
|
||||
use mongodb::bson::doc;
|
||||
use rauth::entities::Account;
|
||||
use revolt_quark::{models::User, Database, EmptyResponse, Error, Result};
|
||||
use rocket::{serde::json::Json, State};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use validator::Validate;
|
||||
@@ -22,6 +22,10 @@ pub async fn req(
|
||||
data: Json<Data>,
|
||||
) -> Result<EmptyResponse> {
|
||||
let data = data.into_inner();
|
||||
account.verify_password(&data.password).map_err(|_| Error::InvalidCredentials)?;
|
||||
user.update_username(db, data.username).await.map(|_| EmptyResponse)
|
||||
account
|
||||
.verify_password(&data.password)
|
||||
.map_err(|_| Error::InvalidCredentials)?;
|
||||
user.update_username(db, data.username)
|
||||
.await
|
||||
.map(|_| EmptyResponse)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user