mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-04-08 02:31:36 +02:00
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:
parent
125251aa5c
commit
2dcc0ad706
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue