Changes
This commit is contained in:
@ -7,16 +7,16 @@ pub struct Params {
|
||||
}
|
||||
|
||||
pub async fn create(
|
||||
State(state): State<AppState>,
|
||||
State(pool): State<Pool>,
|
||||
claims: Claims,
|
||||
Json(params): Json<Params>,
|
||||
) -> Result<Json<Uuid>, StatusCode> {
|
||||
db::folder::get_permissions(params.parent_folder_id, claims.user_id, &state.pool)
|
||||
db::folder::get_permissions(params.parent_folder_id, claims.user_id, &pool)
|
||||
.await
|
||||
.handle_internal()?
|
||||
.can_write_guard()?;
|
||||
|
||||
let exists = db::folder::name_exists(params.parent_folder_id, ¶ms.folder_name, &state.pool)
|
||||
let exists = db::folder::name_exists(params.parent_folder_id, ¶ms.folder_name, &pool)
|
||||
.await
|
||||
.handle_internal()?;
|
||||
if exists {
|
||||
@ -27,7 +27,7 @@ pub async fn create(
|
||||
params.parent_folder_id,
|
||||
claims.user_id,
|
||||
¶ms.folder_name,
|
||||
&state.pool,
|
||||
&pool,
|
||||
)
|
||||
.await
|
||||
.handle_internal()?;
|
||||
|
Reference in New Issue
Block a user