From 04d48515e999d8658cda127a21a7fcf17abfab06 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Sat, 28 Jun 2025 16:29:12 -0400 Subject: [PATCH] Adding some helpful info for the response body --- src/callers/song.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/callers/song.rs b/src/callers/song.rs index 87b1a51..c10293a 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -743,16 +743,19 @@ pub mod endpoint { let raw_data: Vec = data.to_vec(); match song_queue::update(&pool, &raw_data, &id).await { - Ok(_queued_data) => { + Ok(_) => { + response.subject = String::from("Successful"); response.data.push(id); (axum::http::StatusCode::OK, axum::Json(response)) } Err(err) => { + response.subject = String::from("Error"); response.message = err.to_string(); (axum::http::StatusCode::BAD_REQUEST, axum::Json(response)) } } } else { + response.subject = String::from("Error"); response.message = String::from("No data provided"); (axum::http::StatusCode::NOT_FOUND, axum::Json(response)) }