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

Function AssigneeSearchFunc

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

AssigneeSearchFunc returns a search function for MultiSelectWithSearch that dynamically fetches assignable actors for the given assignable (Issue/PR) node ID.

(apiClient *api.Client, repo ghrepo.Interface, assignableID string)

Source from the content-addressed store, hash-verified

660// AssigneeSearchFunc returns a search function for MultiSelectWithSearch that
661// dynamically fetches assignable actors for the given assignable (Issue/PR) node ID.
662func AssigneeSearchFunc(apiClient *api.Client, repo ghrepo.Interface, assignableID string) func(string) prompter.MultiSelectSearchResult {
663 return func(input string) prompter.MultiSelectSearchResult {
664 actors, count, err := api.SuggestedAssignableActors(apiClient, repo, assignableID, input)
665 if err != nil {
666 return prompter.MultiSelectSearchResult{Err: err}
667 }
668 return actorsToSearchResult(actors, count)
669 }
670}
671
672// RepoAssigneeSearchFunc returns a search function for MultiSelectWithSearch that
673// dynamically fetches assignable actors at the repository level. Used during create

Callers 1

editRunFunction · 0.92

Calls 2

actorsToSearchResultFunction · 0.85

Tested by

no test coverage detected