cargo fmt
This commit is contained in:
@@ -269,23 +269,21 @@ pub mod endpoint {
|
|||||||
|
|
||||||
(axum::http::StatusCode::OK, axum::Json(response))
|
(axum::http::StatusCode::OK, axum::Json(response))
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => match err {
|
||||||
match err {
|
sqlx::Error::RowNotFound => {
|
||||||
sqlx::Error::RowNotFound => {
|
response.message = String::from("Nothing to fetch");
|
||||||
response.message = String::from("Nothing to fetch");
|
|
||||||
|
|
||||||
(axum::http::StatusCode::NO_CONTENT, axum::Json(response))
|
(axum::http::StatusCode::NO_CONTENT, axum::Json(response))
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
eprintln!("Error: {err:?}");
|
eprintln!("Error: {err:?}");
|
||||||
response.message = String::from("Error");
|
response.message = String::from("Error");
|
||||||
(
|
(
|
||||||
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
axum::Json(response),
|
axum::Json(response),
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,14 +106,10 @@ pub async fn fetch(
|
|||||||
.fetch_one(pool)
|
.fetch_one(pool)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(row) => {
|
Ok(row) => match parse_row(&row).await {
|
||||||
match parse_row(&row).await {
|
Ok(scheduled_message) => Ok(scheduled_message),
|
||||||
Ok(scheduled_message) => {
|
Err(err) => Err(err),
|
||||||
Ok(scheduled_message)
|
},
|
||||||
}
|
|
||||||
Err(err) => Err(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(err) => Err(err),
|
Err(err) => Err(err),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user