mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 10:54:25 +02:00
Fix test
This commit is contained in:
3 files changed
+18
-21
No files matched your search
@@ -105,9 +105,18 @@
|
||||
|
||||
-
|
||||
id: 12
|
||||
type: 22 # review
|
||||
poster_id: 100
|
||||
type: 22 # review comment
|
||||
poster_id: 1
|
||||
issue_id: 3
|
||||
content: ""
|
||||
review_id: 10
|
||||
created_unix: 946684812
|
||||
review_id: 5
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 13
|
||||
type: 21 # code comment
|
||||
poster_id: 1
|
||||
issue_id: 3
|
||||
content: "Some codes need to be changed"
|
||||
review_id: 5
|
||||
created_unix: 946684810
|
||||
@@ -1168,15 +1168,10 @@ func DeleteComment(ctx context.Context, comment *Comment) (*Comment, error) {
|
||||
return nil, err
|
||||
}
|
||||
if has && reviewComment.Content == "" {
|
||||
if err := reviewComment.LoadAttachments(ctx); err != nil {
|
||||
if _, err := db.GetEngine(ctx).ID(reviewComment.ID).Delete(new(Comment)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(reviewComment.Attachments) == 0 {
|
||||
if _, err := db.GetEngine(ctx).ID(reviewComment.ID).Delete(new(Comment)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
deletedReviewComment = &reviewComment
|
||||
}
|
||||
deletedReviewComment = &reviewComment
|
||||
}
|
||||
comment.ReviewID = 0 // reset review ID to 0 for the notification
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user