feat: Webhook system + CLI tool #2

Merged
hzhang merged 22 commits from feat/webhook-and-cli into main 2026-02-24 04:11:53 +00:00
Showing only changes of commit 9d831e932c - Show all commits

View File

@@ -490,3 +490,28 @@ def dashboard_stats(project_id: int = None, db: Session = Depends(get_db)):
"by_type": by_type,
"by_priority": by_priority,
}
# ============ Comments (update/delete) ============
@app.patch("/comments/{comment_id}", response_model=schemas.CommentResponse)
def update_comment(comment_id: int, comment_update: schemas.CommentUpdate, db: Session = Depends(get_db)):
comment = db.query(models.Comment).filter(models.Comment.id == comment_id).first()
if not comment:
raise HTTPException(status_code=404, detail="Comment not found")
for field, value in comment_update.model_dump(exclude_unset=True).items():
setattr(comment, field, value)
db.commit()
db.refresh(comment)
return comment
@app.delete("/comments/{comment_id}", status_code=status.HTTP_204_NO_CONTENT)
def delete_comment(comment_id: int, db: Session = Depends(get_db)):
comment = db.query(models.Comment).filter(models.Comment.id == comment_id).first()
if not comment:
raise HTTPException(status_code=404, detail="Comment not found")
db.delete(comment)
db.commit()
return None