(ctx context.Context, identifier string)
| 359 | } |
| 360 | |
| 361 | func (s *IssueService) getUserByIdentifier(ctx context.Context, identifier string) (*store.UserMessage, error) { |
| 362 | email := strings.TrimPrefix(identifier, "users/") |
| 363 | if email == "" { |
| 364 | return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid empty creator identifier")) |
| 365 | } |
| 366 | account, err := s.store.GetAccountByEmail(ctx, email) |
| 367 | if err != nil { |
| 368 | return nil, connect.NewError(connect.CodeInternal, errors.Errorf(`failed to find user "%s" with error: %v`, email, err.Error())) |
| 369 | } |
| 370 | if account == nil { |
| 371 | return nil, errors.Errorf("cannot found user %s", email) |
| 372 | } |
| 373 | return &store.UserMessage{ |
| 374 | Email: account.Email, |
| 375 | Name: account.Name, |
| 376 | Type: account.Type, |
| 377 | MemberDeleted: account.MemberDeleted, |
| 378 | }, nil |
| 379 | } |
| 380 | |
| 381 | // CreateIssue creates a issue. |
| 382 | func (s *IssueService) CreateIssue(ctx context.Context, req *connect.Request[v1pb.CreateIssueRequest]) (*connect.Response[v1pb.Issue], error) { |
no test coverage detected