mirror of
https://github.com/vee1e/bulk-questionnaire-upload.git
synced 2026-09-01 09:50:06 +00:00
feat: add search functionality, delete all forms, and simplify upload area
This commit is contained in:
parent
9c31454c35
commit
9cef570f36
6 changed files with 122 additions and 33 deletions
|
|
@ -123,5 +123,19 @@ async def delete_form(form_id: str):
|
|||
logger.error(f"Error deleting form: {str(e)}")
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
@app.delete("/api/forms")
|
||||
async def delete_all_forms():
|
||||
"""
|
||||
Delete all forms and all related data
|
||||
"""
|
||||
try:
|
||||
success = await db_service.delete_all_forms()
|
||||
if not success:
|
||||
raise HTTPException(status_code=500, detail="Failed to delete all forms")
|
||||
return {"message": "All forms deleted successfully"}
|
||||
except Exception as e:
|
||||
logger.error(f"Error deleting all forms: {str(e)}")
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(app, host="0.0.0.0", port=8000)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue