We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 65ddcff + deb0e54 commit c2c497aCopy full SHA for c2c497a
code/services/comment-service/src/server.go
@@ -160,6 +160,24 @@ func (s *CommentServer) DeleteComment(ctx context.Context, req *commentpb.Delete
160
return nil, err
161
}
162
163
+ // find all child comments
164
+ comments, err := s.ListComments(ctx, &commentpb.ListCommentsRequest{
165
+ ThreadId: &res.Id,
166
+ })
167
+ if err != nil {
168
+ return nil, err
169
+ }
170
+
171
+ // delete child comments
172
+ for _, comment := range comments.Comments {
173
+ _, err = s.DeleteComment(ctx, &commentpb.DeleteCommentRequest{
174
+ Id: comment.Id,
175
176
177
178
179
180
181
// delete comment
182
_, err = s.DBClient.DeleteComment(ctx, &dbpb.DeleteCommentRequest{
183
Id: req.Id,
0 commit comments