Skip to content

Commit 7bd6f17

Browse files
committed
delete metadata while delete archive
1 parent 31e2ccb commit 7bd6f17

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

comiclib/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ def delete_archive(id: str, db: Session = Depends(get_db)):
342342
if a is None:
343343
return JSONResponse({"operation": "", "error": "This ID doesn't exist on the server.", "success": 0}, status.HTTP_400_BAD_REQUEST)
344344
p = Path(settings.content) / a.path
345+
db.execute(delete(Archive).where(Archive.id == id))
346+
db.commit()
345347
if p.is_file():
346348
p.unlink()
347349
else:

0 commit comments

Comments
 (0)