diff --git a/src/handlers/auth_handlers.rs b/src/handlers/auth_handlers.rs index f92b69e..9b0af42 100644 --- a/src/handlers/auth_handlers.rs +++ b/src/handlers/auth_handlers.rs @@ -123,14 +123,14 @@ pub async fn signup_handler( .unwrap(); if let Some(_) = created_user { - Ok(StatusCode::ACCEPTED) + Ok(StatusCode::ACCEPTED) } else { - Err(StatusCode::INTERNAL_SERVER_ERROR) + Err(StatusCode::INTERNAL_SERVER_ERROR) } } Err(e) => { eprintln!("Failed to insert user into the database: {}", e); - Err(StatusCode::INTERNAL_SERVER_ERROR) + Err(StatusCode::INTERNAL_SERVER_ERROR) } } } @@ -314,15 +314,15 @@ pub async fn new_password_handler( .await .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; - Ok(Json("Password updated successfully".to_string())) + Ok(Json("Password updated successfully".to_string())) } else { // Token not found txn.rollback().await.unwrap(); - Err(StatusCode::BAD_REQUEST) + Err(StatusCode::BAD_REQUEST) } } else { // One or both are missing - Err(StatusCode::BAD_REQUEST) + Err(StatusCode::BAD_REQUEST) } } diff --git a/src/handlers/cp_handler.rs b/src/handlers/cp_handler.rs index b99c84f..ca6ab74 100644 --- a/src/handlers/cp_handler.rs +++ b/src/handlers/cp_handler.rs @@ -5,10 +5,7 @@ use tokio::fs::{create_dir_all, File}; use tokio::io::AsyncWriteExt; use crate::utils::scripts::{compare_with_answer_file, docker_run}; -pub fn code_handler( - mut multipart: Multipart, -) -> Result, StatusCode> { - +pub fn code_handler(mut multipart: Multipart) -> Result, StatusCode> { todo!(); // while let Some(field) = multipart.next_field().await.unwrap() { // let filename = field diff --git a/src/handlers/crud_handlers.rs b/src/handlers/crud_handlers.rs index 5fed92c..f9b18b4 100644 --- a/src/handlers/crud_handlers.rs +++ b/src/handlers/crud_handlers.rs @@ -429,7 +429,7 @@ pub async fn reject_handler( .await; if let Err(_) = flag_update_result { - ( + ( StatusCode::INTERNAL_SERVER_ERROR, Json("Failed to update flags to 0"), )