Create Project APIs.
This commit is contained in:
parent
d8094c4812
commit
8b32739e51
13 changed files with 297 additions and 7 deletions
|
|
@ -1,3 +1,4 @@
|
|||
mod projects;
|
||||
mod tasks;
|
||||
|
||||
use axum::{
|
||||
|
|
@ -26,11 +27,14 @@ pub struct ErrorJson {
|
|||
impl IntoResponse for AppError {
|
||||
fn into_response(self) -> axum::response::Response {
|
||||
match self {
|
||||
Self::InternalError(anyhow_error) => (
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
format!("Something went wrong {}", anyhow_error),
|
||||
)
|
||||
.into_response(),
|
||||
Self::InternalError(anyhow_error) => {
|
||||
error!(err = ?anyhow_error, "Internal Server Error");
|
||||
(
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
format!("Something went wrong {}", anyhow_error),
|
||||
)
|
||||
.into_response()
|
||||
}
|
||||
Self::JsonExtractError(rej) => (
|
||||
StatusCode::UNPROCESSABLE_ENTITY,
|
||||
Json(ErrorJson {
|
||||
|
|
@ -85,5 +89,7 @@ impl From<sqlx::Error> for AppError {
|
|||
}
|
||||
}
|
||||
|
||||
pub use projects::*;
|
||||
use serde::Serialize;
|
||||
pub use tasks::*;
|
||||
use tracing::error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue