Skip to content

Commit

Permalink
updated json for repo data
Browse files Browse the repository at this point in the history
  • Loading branch information
Kshitij-Katiyar committed Jan 17, 2025
1 parent a3488a0 commit dc5832e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server/plugin/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className={'form-group x3'}>
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/types/github_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export type DefaultRepo = {

export type YourReposData = {
defaultRepo?: DefaultRepo;
repo: ReposData[];
repos: ReposData[];
}

export type ReposData = {
Expand Down

0 comments on commit dc5832e

Please sign in to comment.