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:
@@ -664,6 +664,10 @@ pub mod endpoint {
|
||||
|
||||
match super::song_queue::get_song_queue(&pool, &payload.song_queue_id).await {
|
||||
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))
|
||||
}
|
||||
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(
|
||||
axum::Extension(pool): axum::Extension<sqlx::PgPool>,
|
||||
|
||||
Reference in New Issue
Block a user