Cleanup
This commit is contained in:
@@ -230,22 +230,22 @@ pub async fn get_ticket_by_id(
|
||||
user_last_name: row.get("last_name"),
|
||||
};
|
||||
let response = serde_json::json!(ticket_response);
|
||||
return Ok(Json(response));
|
||||
Ok(Json(response))
|
||||
}
|
||||
Err(sqlx::Error::RowNotFound) => {
|
||||
let error_response = serde_json::json!({
|
||||
"status": "fail",
|
||||
"message": format!("Ticket with ID {} not found", id)
|
||||
});
|
||||
return Err((StatusCode::NOT_FOUND, Json(error_response)));
|
||||
Err((StatusCode::NOT_FOUND, Json(error_response)))
|
||||
}
|
||||
Err(e) => {
|
||||
return Err((
|
||||
Err((
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
Json(json!({"status": "error", "message": format!("{:?}", e)})),
|
||||
));
|
||||
))
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// Updates a ticket's status.
|
||||
|
||||
Reference in New Issue
Block a user