Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-420] Add feature to support multiple orgs in plugin settings #773

Merged
merged 15 commits into from
Jul 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[MM-420] Fix lint error
  • Loading branch information
ayusht2810 committed May 8, 2024
commit d19986c26e53ee8f034d050f58c78265fad47a1b
24 changes: 12 additions & 12 deletions server/plugin/graphql/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (

// Client encapsulates the third party package that communicates with Github GraphQL API
type Client struct {
client *githubv4.Client
org string
username string
logger pluginapi.LogService
client *githubv4.Client
org string
username string
logger pluginapi.LogService
getOrganizations func() []string
}

Expand All @@ -29,10 +29,10 @@ func NewClient(logger pluginapi.LogService, getOrganizations func() []string, to

if enterpriseBaseURL == "" {
client = Client{
username: username,
client: githubv4.NewClient(httpClient),
logger: logger,
org: orgName,
username: username,
client: githubv4.NewClient(httpClient),
logger: logger,
org: orgName,
getOrganizations: getOrganizations,
}
} else {
Expand All @@ -45,10 +45,10 @@ func NewClient(logger pluginapi.LogService, getOrganizations func() []string, to
baseURL.Path = path.Join(baseURL.Path, "api", "graphql")

client = Client{
client: githubv4.NewEnterpriseClient(baseURL.String(), httpClient),
username: username,
org: orgName,
logger: logger,
client: githubv4.NewEnterpriseClient(baseURL.String(), httpClient),
username: username,
org: orgName,
logger: logger,
getOrganizations: getOrganizations,
}
}
Expand Down
Loading