Error fixes
type mismatch in update user and some styling improvements
This commit is contained in:
@@ -268,7 +268,7 @@ pub async fn get_current_user(
|
||||
/// - `404 Not Found` if user doesn't exist
|
||||
/// - `500 Internal Server Error` if database error occurs
|
||||
pub async fn delete_user(
|
||||
Path(id): Path<i32>,
|
||||
Path(id): Path<i16>,
|
||||
State(data): State<Arc<AppState>>,
|
||||
) -> Result<impl IntoResponse, (StatusCode, Json<serde_json::Value>)> {
|
||||
let query = sqlx::query(r#"DELETE FROM users WHERE id = $1"#)
|
||||
@@ -411,7 +411,7 @@ pub async fn get_user_by_id(
|
||||
/// - This endpoint requires admin privileges (enforced by middleware via
|
||||
/// [`validate_admin`](crate::cookie::validation::validate_admin)).
|
||||
pub async fn update_user(
|
||||
Path(id): Path<i32>,
|
||||
Path(id): Path<i16>,
|
||||
State(data): State<Arc<AppState>>,
|
||||
Json(body): Json<UserUpdateScheme>,
|
||||
) -> Result<impl IntoResponse, (StatusCode, Json<serde_json::Value>)> {
|
||||
|
||||
Reference in New Issue
Block a user