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)
| 673 | // dynamically fetches assignable actors at the repository level. Used during create |
| 674 | // flows where no issue/PR node ID exists yet. |
| 675 | func RepoAssigneeSearchFunc(apiClient *api.Client, repo ghrepo.Interface) func(string) prompter.MultiSelectSearchResult { |
| 676 | return func(input string) prompter.MultiSelectSearchResult { |
| 677 | actors, count, err := api.SearchRepoAssignableActors(apiClient, repo, input) |
| 678 | if err != nil { |
| 679 | return prompter.MultiSelectSearchResult{Err: err} |
| 680 | } |
| 681 | return actorsToSearchResult(actors, count) |
| 682 | } |
| 683 | } |
| 684 | |
| 685 | func actorsToSearchResult(actors []api.AssignableActor, totalCount int) prompter.MultiSelectSearchResult { |
| 686 | logins := make([]string, 0, len(actors)) |
no test coverage detected