feat: Add case closing and document viewing routes
Adds API endpoints for closing a case, which triggers an analysis job, and for viewing the generated document. This also includes: - New `AppError` variants: `Conflict` and `ServiceUnavailable`. - Helper functions for file handling, date parsing, and document searching. - Unit tests for helper functions.
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
mod case_actions;
|
||||
mod debug;
|
||||
mod health;
|
||||
mod login;
|
||||
mod upload;
|
||||
pub(crate) mod user_web;
|
||||
pub(crate) mod web;
|
||||
mod user_web;
|
||||
|
||||
use axum::routing::{get, post};
|
||||
use axum::Router;
|
||||
@@ -19,6 +20,14 @@ pub fn api_router() -> Router<AppState> {
|
||||
.route("/web/logout", post(login::handle_logout))
|
||||
.route("/web/cases", get(user_web::handle_my_cases))
|
||||
.route("/web/cases/{case_id}", get(user_web::handle_case_detail))
|
||||
.route(
|
||||
"/web/cases/{case_id}/close",
|
||||
post(case_actions::handle_close_case),
|
||||
)
|
||||
.route(
|
||||
"/web/cases/{case_id}/document",
|
||||
get(case_actions::handle_document_view),
|
||||
)
|
||||
.route("/web/", get(web::handle_case_list))
|
||||
.route(
|
||||
"/web/audio/{user}/{case_id}/{filename}",
|
||||
|
||||
Reference in New Issue
Block a user