diff --git a/server/plugin/api.go b/server/plugin/api.go index bc40d8bb1..49ffd8296 100644 --- a/server/plugin/api.go +++ b/server/plugin/api.go @@ -62,7 +62,7 @@ type RepoResponse struct { // Only send down fields to client that are needed type RepositoryResponse struct { DefaultRepo RepoResponse `json:"defaultRepo,omitempty"` - Repos []RepoResponse `json:"repo,omitempty"` + Repos []RepoResponse `json:"repos,omitempty"` } type PRDetails struct { diff --git a/webapp/src/components/github_repo_selector/github_repo_selector.jsx b/webapp/src/components/github_repo_selector/github_repo_selector.jsx index 0d4c83ac6..f6b72a8b6 100644 --- a/webapp/src/components/github_repo_selector/github_repo_selector.jsx +++ b/webapp/src/components/github_repo_selector/github_repo_selector.jsx @@ -43,12 +43,12 @@ export default class GithubRepoSelector extends PureComponent { } onChange = (_, name) => { - const repo = this.props.yourRepos.repo.find((r) => r.full_name === name); + const repo = this.props.yourRepos.repos.find((r) => r.full_name === name); this.props.onChange({name, permissions: repo.permissions}); } render() { - const repoOptions = this.props.yourRepos.repo.map((item) => ({value: item.full_name, label: item.full_name})); + const repoOptions = this.props.yourRepos.repos.map((item) => ({value: item.full_name, label: item.full_name})); return (
diff --git a/webapp/src/reducers/index.ts b/webapp/src/reducers/index.ts index 81cab1c12..4a59927f6 100644 --- a/webapp/src/reducers/index.ts +++ b/webapp/src/reducers/index.ts @@ -107,7 +107,7 @@ function sidebarContent(state = { } function yourRepos(state: YourReposData = { - repo: [], + repos: [], }, action: {type: string, data: YourReposData}) { switch (action.type) { case ActionTypes.RECEIVED_REPOSITORIES: diff --git a/webapp/src/types/github_types.ts b/webapp/src/types/github_types.ts index d0caddc71..cd1c6ab08 100644 --- a/webapp/src/types/github_types.ts +++ b/webapp/src/types/github_types.ts @@ -93,7 +93,7 @@ export type DefaultRepo = { export type YourReposData = { defaultRepo?: DefaultRepo; - repo: ReposData[]; + repos: ReposData[]; } export type ReposData = {