style: cargo clippy --fix && cargo fmt
This commit is contained in:
parent
ad24215fef
commit
8e31dc7aca
2 changed files with 14 additions and 12 deletions
|
@ -2,25 +2,27 @@ use std::sync::Arc;
|
|||
|
||||
use axum::{
|
||||
Extension,
|
||||
extract::{Path, State, Json},
|
||||
extract::{Json, Path, State},
|
||||
http::StatusCode,
|
||||
response::IntoResponse,
|
||||
};
|
||||
use diesel::{insert_into, RunQueryDsl};
|
||||
use serde::Deserialize;
|
||||
|
||||
use crate::{
|
||||
api::v1::auth::CurrentUser, error::Error, objects::{Me, Member, Permissions}, schema::guild_bans::{self, dsl}, utils::global_checks, AppState
|
||||
AppState,
|
||||
api::v1::auth::CurrentUser,
|
||||
error::Error,
|
||||
objects::{Member, Permissions},
|
||||
utils::global_checks,
|
||||
};
|
||||
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct RequstBody {
|
||||
reason: String
|
||||
reason: String,
|
||||
}
|
||||
|
||||
|
||||
pub async fn post(
|
||||
State(app_state): State<Arc<AppState>>,
|
||||
Path(member_uuid): Path<Uuid>,
|
||||
|
@ -38,10 +40,11 @@ pub async fn post(
|
|||
}
|
||||
|
||||
let baner = Member::check_membership(&mut conn, uuid, member.guild_uuid).await?;
|
||||
baner.check_permission(&app_state, Permissions::ManageMember).await?;
|
||||
baner
|
||||
.check_permission(&app_state, Permissions::ManageMember)
|
||||
.await?;
|
||||
|
||||
member.ban(&mut conn, &payload.reason).await?;
|
||||
|
||||
|
||||
Ok(StatusCode::OK)
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use axum::http::StatusCode;
|
||||
use diesel::{
|
||||
ExpressionMethods, Insertable, QueryDsl, Queryable, Selectable, SelectableHelper, delete,
|
||||
insert_into,
|
||||
|
@ -11,8 +10,8 @@ use crate::{
|
|||
AppState, Conn,
|
||||
error::Error,
|
||||
objects::{Me, Permissions, Role},
|
||||
schema::guild_members,
|
||||
schema::guild_bans,
|
||||
schema::guild_members,
|
||||
};
|
||||
|
||||
use super::{User, load_or_empty};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue