RepoAssigneeSearchFunc returns a search function for MultiSelectWithSearch that dynamically fetches assignable actors at the repository level. Used during create flows where no issue/PR node ID exists yet.
(apiClient *api.Client, repo ghrepo.Interface)
| 688 | // dynamically fetches assignable actors at the repository level. Used during create |
| 689 | // flows where no issue/PR node ID exists yet. |
| 690 | func RepoAssigneeSearchFunc(apiClient *api.Client, repo ghrepo.Interface) func(string) prompter.MultiSelectSearchResult { |
| 691 | return func(input string) prompter.MultiSelectSearchResult { |
| 692 | actors, count, err := api.SearchRepoAssignableActors(apiClient, repo, input) |
| 693 | if err != nil { |
| 694 | return prompter.MultiSelectSearchResult{Err: err} |
| 695 | } |
| 696 | return actorsToSearchResult(actors, count) |
| 697 | } |
| 698 | } |
| 699 | |
| 700 | func actorsToSearchResult(actors []api.AssignableActor, totalCount int) prompter.MultiSelectSearchResult { |
| 701 | logins := make([]string, 0, len(actors)) |
no test coverage detected