From 4af06e7facb0533b762c4c6f46a93a703d12af87 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 18 Jul 2025 19:14:22 -0400 Subject: [PATCH] Finished adding code #156 Need to make the endpoint available and then write a test. Might have to modify existing tests --- src/callers/song.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/callers/song.rs b/src/callers/song.rs index a0bfea7..1414508 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -664,7 +664,17 @@ pub mod endpoint { match super::song_queue::get_song_queue(&pool, &payload.song_queue_id).await { Ok(song_queue) => { - (axum::http::StatusCode::OK, axum::Json(response)) + match super::song_queue::link_user_id(&pool, &song_queue.id, &payload.user_id).await { + Ok(user_id) => { + response.message = String::from(crate::callers::response::SUCCESSFUL); + response.data.push(user_id); + (axum::http::StatusCode::OK, axum::Json(response)) + } + Err(err) => { + response.message = err.to_string(); + (axum::http::StatusCode::BAD_REQUEST, axum::Json(response)) + } + } } Err(err) => { response.message = err.to_string();