icarus_models version bump #190

Merged
kdeng00 merged 6 commits from icarus_models-ver_bump into main 2025-10-11 19:50:56 -04:00
Showing only changes of commit 0b636d5557 - Show all commits
+27 -1
View File
@@ -1229,8 +1229,33 @@ pub mod endpoint {
}
}
let save_path = dir.join(&song.filename);
match song.save_to_filesystem() {
Ok(_) => {
match super::song_db::insert(&pool, &song).await {
Ok((date_created, id)) => {
song.id = id;
song.date_created = date_created;
response.message = String::from("Successful");
response.data.push(song);
(axum::http::StatusCode::OK, axum::Json(response))
}
Err(err) => {
response.message =
format!("{:?} song {:?}", err.to_string(), song);
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
}
}
}
Err(err) => {
response.message = err.to_string();
(axum::http::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(response))
}
}
// let save_path = dir.join(&song.filename);
/*
match std::fs::File::create(&save_path) {
Ok(mut file) => {
file.write_all(&song.data).unwrap();
@@ -1269,6 +1294,7 @@ pub mod endpoint {
)
}
}
*/
}
Err(err) => {
response.message = err.to_string();