"""
return layout("Library", body)
@@ -730,6 +804,20 @@ def delete_document(doc_id: int):
return HTMLResponse("")
+@app.post("/documents/bulk-move", response_class=HTMLResponse)
+def bulk_move_documents(ids: List[int] = Form(...), project_id: int = Form(...)):
+ with db() as c:
+ c.executemany("UPDATE documents SET project_id=? WHERE id=?", [(project_id, i) for i in ids])
+ return HTMLResponse("")
+
+
+@app.post("/documents/bulk-delete", response_class=HTMLResponse)
+def bulk_delete_documents(ids: List[int] = Form(...)):
+ with db() as c:
+ c.executemany("DELETE FROM documents WHERE id=?", [(i,) for i in ids])
+ return HTMLResponse("")
+
+
@app.get("/prompts", response_class=HTMLResponse)
def prompts_page():
with db() as c: