Create Project APIs.
Some checks failed
Check / Backend (pull_request) Failing after 3m14s
Check / Frontend (pull_request) Successful in 1m59s

This commit is contained in:
Drew 2025-10-22 22:20:14 -07:00
parent d8094c4812
commit 8b32739e51
13 changed files with 297 additions and 7 deletions

View file

@ -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;