tsk-176: Formatting

This commit is contained in:
kdeng00
2025-08-18 19:49:15 -04:00
parent ed28b7303d
commit 14014c35f8
+11 -8
View File
@@ -351,11 +351,13 @@ pub mod song_db {
}
}
pub async fn get_all_songs(pool: &sqlx::PgPool) -> Result<Vec<icarus_models::song::Song>, sqlx::Error> {
pub async fn get_all_songs(
pool: &sqlx::PgPool,
) -> Result<Vec<icarus_models::song::Song>, sqlx::Error> {
let result = sqlx::query(
r#"
SELECT * FROM "song";
"#
"#,
)
.fetch_all(pool)
.await
@@ -368,7 +370,6 @@ pub mod song_db {
let mut songs: Vec<icarus_models::song::Song> = Vec::new();
for row in rows {
let date_created_time: time::OffsetDateTime = row
.try_get("date_created")
.map_err(|_e| sqlx::Error::RowNotFound)
@@ -448,9 +449,7 @@ pub mod song_db {
Ok(songs)
}
Err(_err) => {
Err(sqlx::Error::RowNotFound)
}
Err(_err) => Err(sqlx::Error::RowNotFound),
}
}
@@ -1229,8 +1228,12 @@ pub mod endpoint {
}
}
pub async fn get_all_songs(axum::Extension(pool): axum::Extension<sqlx::PgPool>,
) -> (axum::http::StatusCode, axum::Json<super::response::get_songs::Response>) {
pub async fn get_all_songs(
axum::Extension(pool): axum::Extension<sqlx::PgPool>,
) -> (
axum::http::StatusCode,
axum::Json<super::response::get_songs::Response>,
) {
let mut response = super::response::get_songs::Response::default();
match super::song_db::get_all_songs(&pool).await {