Update song queue changes #145
@@ -2,6 +2,8 @@
|
||||
|
||||
/target
|
||||
.env
|
||||
.env.docker
|
||||
.env.local
|
||||
|
||||
.DS_STORE
|
||||
Storage/
|
||||
|
||||
+4
-3
@@ -123,7 +123,7 @@ pub mod response {
|
||||
#[derive(Default, serde::Deserialize, serde::Serialize)]
|
||||
pub struct Response {
|
||||
pub message: String,
|
||||
pub data: Vec<Vec<u8>>,
|
||||
pub data: Vec<uuid::Uuid>,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -743,8 +743,9 @@ pub mod endpoint {
|
||||
|
||||
let raw_data: Vec<u8> = data.to_vec();
|
||||
match song_queue::update(&pool, &raw_data, &id).await {
|
||||
Ok(queued_data) => {
|
||||
response.data.push(queued_data);
|
||||
Ok(_) => {
|
||||
response.message = String::from("Successful");
|
||||
response.data.push(id);
|
||||
(axum::http::StatusCode::OK, axum::Json(response))
|
||||
}
|
||||
Err(err) => {
|
||||
|
||||
@@ -822,6 +822,13 @@ mod tests {
|
||||
resp.data.is_empty(),
|
||||
"Should not be empty"
|
||||
);
|
||||
|
||||
let updated_song_queued_id = resp.data[0];
|
||||
assert_eq!(
|
||||
updated_song_queued_id, *id,
|
||||
"Song queue Id should match, but they don't. {:?} {:?}",
|
||||
updated_song_queued_id, id
|
||||
);
|
||||
}
|
||||
Err(err) => {
|
||||
assert!(false, "Error: {:?}", err);
|
||||
|
||||
Reference in New Issue
Block a user