(ctx context.Context, input models.BugCreateInput)
| 40 | } |
| 41 | |
| 42 | func (r mutationResolver) BugCreate(ctx context.Context, input models.BugCreateInput) (*models.BugCreatePayload, error) { |
| 43 | repo, err := r.getRepo(input.RepoRef) |
| 44 | if err != nil { |
| 45 | return nil, err |
| 46 | } |
| 47 | |
| 48 | author, err := auth.UserFromCtx(ctx, repo) |
| 49 | if err != nil { |
| 50 | return nil, err |
| 51 | } |
| 52 | |
| 53 | b, op, err := repo.Bugs().NewRaw(author, |
| 54 | time.Now().Unix(), |
| 55 | text.CleanupOneLine(input.Title), |
| 56 | text.Cleanup(input.Message), |
| 57 | input.Files, |
| 58 | nil) |
| 59 | if err != nil { |
| 60 | return nil, err |
| 61 | } |
| 62 | |
| 63 | return &models.BugCreatePayload{ |
| 64 | ClientMutationID: input.ClientMutationID, |
| 65 | Bug: models.NewLoadedBug(b.Snapshot()), |
| 66 | Operation: op, |
| 67 | }, nil |
| 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) |
nothing calls this directly
no test coverage detected