Add delete button for draft files in case drafts panel
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 45s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 45s
- Add DELETE /api/cases/{case_number}/exports/{filename} endpoint
- Add useDeleteDraft hook in exports API
- Add trash icon + confirmation dialog in drafts panel UI
- Final files (סופי-) cannot be deleted as a safety measure
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
11
web/app.py
11
web/app.py
@@ -1907,6 +1907,17 @@ async def api_download_export(case_number: str, filename: str):
|
||||
)
|
||||
|
||||
|
||||
@app.delete("/api/cases/{case_number}/exports/{filename}")
|
||||
async def api_delete_export(case_number: str, filename: str):
|
||||
"""Delete an exported draft file."""
|
||||
export_dir = config.find_case_dir(case_number) / "exports"
|
||||
path = export_dir / filename
|
||||
if not path.exists() or not path.parent.samefile(export_dir):
|
||||
raise HTTPException(404, "קובץ לא נמצא")
|
||||
path.unlink()
|
||||
return {"deleted": True, "filename": filename}
|
||||
|
||||
|
||||
@app.post("/api/cases/{case_number}/exports/upload")
|
||||
async def api_upload_export(case_number: str, file: UploadFile = File(...)):
|
||||
"""Upload a revised version of a draft."""
|
||||
|
||||
Reference in New Issue
Block a user