MCPcopy
hub / github.com/cli/cli / RepoAssigneeSearchFunc

Function RepoAssigneeSearchFunc

pkg/cmd/pr/shared/editable.go:690–698  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

688// dynamically fetches assignable actors at the repository level. Used during create
689// flows where no issue/PR node ID exists yet.
690func 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
700func actorsToSearchResult(actors []api.AssignableActor, totalCount int) prompter.MultiSelectSearchResult {
701 logins := make([]string, 0, len(actors))

Callers 1

createRunFunction · 0.92

Calls 2

actorsToSearchResultFunction · 0.85

Tested by

no test coverage detected