(ctx context.Context, input models.BugAddCommentAndCloseInput)
| 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) |
| 104 | if err != nil { |
| 105 | return nil, err |
| 106 | } |
| 107 | |
| 108 | author, err := auth.UserFromCtx(ctx, repo) |
| 109 | if err != nil { |
| 110 | return nil, err |
| 111 | } |
| 112 | |
| 113 | _, opAddComment, err := b.AddCommentRaw(author, |
| 114 | time.Now().Unix(), |
| 115 | text.Cleanup(input.Message), |
| 116 | input.Files, |
| 117 | nil) |
| 118 | if err != nil { |
| 119 | return nil, err |
| 120 | } |
| 121 | |
| 122 | opClose, err := b.CloseRaw(author, time.Now().Unix(), nil) |
| 123 | if err != nil { |
| 124 | return nil, err |
| 125 | } |
| 126 | |
| 127 | err = b.Commit() |
| 128 | if err != nil { |
| 129 | return nil, err |
| 130 | } |
| 131 | |
| 132 | return &models.BugAddCommentAndClosePayload{ |
| 133 | ClientMutationID: input.ClientMutationID, |
| 134 | Bug: models.NewLoadedBug(b.Snapshot()), |
| 135 | CommentOperation: opAddComment, |
| 136 | StatusOperation: opClose, |
| 137 | }, nil |
| 138 | } |
| 139 | |
| 140 | func (r mutationResolver) BugAddCommentAndReopen(ctx context.Context, input models.BugAddCommentAndReopenInput) (*models.BugAddCommentAndReopenPayload, error) { |
| 141 | repo, b, err := r.getBug(input.RepoRef, input.Prefix) |
nothing calls this directly
no test coverage detected