Reviews should be deleted when no comments

Changed the condition as reviews should be deleted
when there are no comments for the review being deleted.
This commit is contained in:
Leni Kadali 2025-04-04 21:08:39 +03:00
parent 125251aa5c
commit 2dcc0ad706

View file

@ -126,7 +126,7 @@ func DeleteComment(ctx context.Context, doer *user_model.User, comment *issues_m
found, err := db.GetEngine(ctx).Table("comment").Where("review_id = ?", reviewID).Exist()
if err != nil {
return err
} else if found {
} else if !found {
_, err := db.GetEngine(ctx).Table("review").Where("id = ?", reviewID).Delete()
if err != nil {
return err