MCPcopy Create free account
hub / github.com/cli/cli / RepoAssigneeSearchFunc

Function RepoAssigneeSearchFunc

pkg/cmd/pr/shared/editable.go:675–683  ·  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

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

Callers 1

createRunFunction · 0.92

Calls 2

actorsToSearchResultFunction · 0.85

Tested by

no test coverage detected