Code formatting

This commit is contained in:
kdeng00
2025-05-01 21:57:27 -04:00
parent 33b19dc4c6
commit 0c58a6e837
2 changed files with 39 additions and 40 deletions
+2 -7
View File
@@ -9,10 +9,7 @@ pub mod response {
mod db {
use sqlx::Row;
pub async fn insert(
pool: &sqlx::PgPool,
data: &Vec<u8>,
) -> Result<uuid::Uuid, sqlx::Error> {
pub async fn insert(pool: &sqlx::PgPool, data: &Vec<u8>) -> Result<uuid::Uuid, sqlx::Error> {
let result = sqlx::query(
r#"
INSERT INTO "coverartQueue" (data) VALUES($1) RETURNING id;
@@ -76,9 +73,7 @@ pub mod endpoint {
}
}
}
Ok(None) => {
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
}
Ok(None) => (axum::http::StatusCode::BAD_REQUEST, axum::Json(response)),
Err(err) => {
response.message = err.to_string();
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
+7 -3
View File
@@ -622,14 +622,18 @@ mod tests {
let body = MultipartBody::from(form);
// Send request
match app.clone().oneshot(
match app
.clone()
.oneshot(
axum::http::Request::builder()
.method(axum::http::Method::POST)
.uri(crate::callers::endpoints::QUEUECOVERART)
.header(axum::http::header::CONTENT_TYPE, content_type)
.body(axum::body::Body::from_stream(body))
.unwrap()
).await {
.unwrap(),
)
.await
{
Ok(response) => {
let resp =
get_resp_data::<crate::callers::coverart::response::Response>(response).await;