Create a plan for implementing projects and also create the backend API. (#19)
Creates projects to organize tasks under. (Note the migration also contains the tables for creating folders for projects as well because adding foreign keys is a PITA in sqlite apparently). Reviewed-on: #19 Co-authored-by: Drew Galbraith <drew@tiramisu.one> Co-committed-by: Drew Galbraith <drew@tiramisu.one>
This commit is contained in:
parent
69f4a6f1ca
commit
4552c347c6
17 changed files with 957 additions and 12 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