Add admin-only case reset functionality
Introduce a new "reset" action for bulk operations and a dedicated endpoint for individual case resets. These features allow administrators to revert a case to its raw audio state by deleting derived artifacts like transcripts, analysis input, and documents. The functionality also includes renaming `.m4a.failed` files back to `.m4a` to re-trigger transcription. This commit also: - Adds a `reset_case_artefacts` helper function to `case_actions.rs`. - Implements the `handle_reset_case` endpoint. - Adds the "Reset" button to the UI for administrators. - Includes unit and integration tests to verify the new functionality and access control.
This commit is contained in:
@@ -29,6 +29,10 @@ pub fn api_router() -> Router<AppState> {
|
||||
"/web/cases/{case_id}/delete",
|
||||
post(case_actions::handle_delete_case),
|
||||
)
|
||||
.route(
|
||||
"/web/cases/{case_id}/reset",
|
||||
post(case_actions::handle_reset_case),
|
||||
)
|
||||
.route(
|
||||
"/web/cases/undo-delete",
|
||||
post(case_actions::handle_undo_delete),
|
||||
|
||||
Reference in New Issue
Block a user