(ctx context.Context, input models.BugSetTitleInput)
| 311 | } |
| 312 | |
| 313 | func (r mutationResolver) BugSetTitle(ctx context.Context, input models.BugSetTitleInput) (*models.BugSetTitlePayload, error) { |
| 314 | repo, b, err := r.getBug(input.RepoRef, input.Prefix) |
| 315 | if err != nil { |
| 316 | return nil, err |
| 317 | } |
| 318 | |
| 319 | author, err := auth.UserFromCtx(ctx, repo) |
| 320 | if err != nil { |
| 321 | return nil, err |
| 322 | } |
| 323 | |
| 324 | op, err := b.SetTitleRaw( |
| 325 | author, |
| 326 | time.Now().Unix(), |
| 327 | text.CleanupOneLine(input.Title), |
| 328 | nil, |
| 329 | ) |
| 330 | if err != nil { |
| 331 | return nil, err |
| 332 | } |
| 333 | |
| 334 | err = b.Commit() |
| 335 | if err != nil { |
| 336 | return nil, err |
| 337 | } |
| 338 | |
| 339 | return &models.BugSetTitlePayload{ |
| 340 | ClientMutationID: input.ClientMutationID, |
| 341 | Bug: models.NewLoadedBug(b.Snapshot()), |
| 342 | Operation: op, |
| 343 | }, nil |
| 344 | } |
nothing calls this directly
no test coverage detected