Finished adding code #156

Need to make the endpoint available and then write a test. Might have to modify existing tests
This commit is contained in:
kdeng00
2025-07-18 19:14:22 -04:00
parent 8de2773a7a
commit 4af06e7fac
+10
View File
@@ -664,6 +664,10 @@ pub mod endpoint {
match super::song_queue::get_song_queue(&pool, &payload.song_queue_id).await { match super::song_queue::get_song_queue(&pool, &payload.song_queue_id).await {
Ok(song_queue) => { Ok(song_queue) => {
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)) (axum::http::StatusCode::OK, axum::Json(response))
} }
Err(err) => { Err(err) => {
@@ -672,6 +676,12 @@ pub mod endpoint {
} }
} }
} }
Err(err) => {
response.message = err.to_string();
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
}
}
}
pub async fn fetch_queue_song( pub async fn fetch_queue_song(
axum::Extension(pool): axum::Extension<sqlx::PgPool>, axum::Extension(pool): axum::Extension<sqlx::PgPool>,