use crate::prelude::*; #[derive(Deserialize, Debug)] pub struct Params { folder_id: Uuid, user_id: i32, } pub async fn delete( claims: Claims, State(state): State, Json(params): Json, ) -> Result { if params.user_id != claims.user_id { db::folder::get_permissions(params.folder_id, claims.user_id, &state.pool) .await .handle_internal()? .can_manage_guard()?; } db::permissions::delete_for_folder(params.folder_id, params.user_id, &state.pool) .await .handle_internal()?; Ok(StatusCode::NO_CONTENT) }