(ctx context.Context, input models.BugAddCommentInput)
| 68 | } |
| 69 | |
| 70 | func (r mutationResolver) BugAddComment(ctx context.Context, input models.BugAddCommentInput) (*models.BugAddCommentPayload, error) { |
| 71 | repo, b, err := r.getBug(input.RepoRef, input.Prefix) |
| 72 | if err != nil { |
| 73 | return nil, err |
| 74 | } |
| 75 | |
| 76 | author, err := auth.UserFromCtx(ctx, repo) |
| 77 | if err != nil { |
| 78 | return nil, err |
| 79 | } |
| 80 | |
| 81 | _, op, err := b.AddCommentRaw(author, |
| 82 | time.Now().Unix(), |
| 83 | text.Cleanup(input.Message), |
| 84 | input.Files, |
| 85 | nil) |
| 86 | if err != nil { |
| 87 | return nil, err |
| 88 | } |
| 89 | |
| 90 | err = b.Commit() |
| 91 | if err != nil { |
| 92 | return nil, err |
| 93 | } |
| 94 | |
| 95 | return &models.BugAddCommentPayload{ |
| 96 | ClientMutationID: input.ClientMutationID, |
| 97 | Bug: models.NewLoadedBug(b.Snapshot()), |
| 98 | Operation: op, |
| 99 | }, nil |
| 100 | } |
| 101 | |
| 102 | func (r mutationResolver) BugAddCommentAndClose(ctx context.Context, input models.BugAddCommentAndCloseInput) (*models.BugAddCommentAndClosePayload, error) { |
| 103 | repo, b, err := r.getBug(input.RepoRef, input.Prefix) |
nothing calls this directly
no test coverage detected