change repository-types to repositoryTypes

This commit is contained in:
Maren Süwer
2018-08-07 12:58:16 +02:00
parent 9a4896b55d
commit 5731b607be
8 changed files with 15 additions and 15 deletions

View File

@@ -32,7 +32,7 @@ export function fetchRepositoryTypesIfNeeded() {
function fetchRepositoryTypes(dispatch: any) {
dispatch(fetchRepositoryTypesPending());
return apiClient
.get("repository-types")
.get("repositoryTypes")
.then(response => response.json())
.then(repositoryTypes => {
dispatch(fetchRepositoryTypesSuccess(repositoryTypes));
@@ -84,7 +84,7 @@ export default function reducer(
action: Action = { type: "UNKNOWN" }
): RepositoryType[] {
if (action.type === FETCH_REPOSITORY_TYPES_SUCCESS && action.payload) {
return action.payload._embedded["repository-types"];
return action.payload._embedded["repositoryTypes"];
}
return state;
}

View File

@@ -22,7 +22,7 @@ const git = {
displayName: "Git",
_links: {
self: {
href: "http://localhost:8081/scm/api/rest/v2/repository-types/git"
href: "http://localhost:8081/scm/api/rest/v2/repositoryTypes/git"
}
}
};
@@ -32,7 +32,7 @@ const hg = {
displayName: "Mercurial",
_links: {
self: {
href: "http://localhost:8081/scm/api/rest/v2/repository-types/hg"
href: "http://localhost:8081/scm/api/rest/v2/repositoryTypes/hg"
}
}
};
@@ -42,18 +42,18 @@ const svn = {
displayName: "Subversion",
_links: {
self: {
href: "http://localhost:8081/scm/api/rest/v2/repository-types/svn"
href: "http://localhost:8081/scm/api/rest/v2/repositoryTypes/svn"
}
}
};
const collection = {
_embedded: {
"repository-types": [git, hg, svn]
repositoryTypes: [git, hg, svn]
},
_links: {
self: {
href: "http://localhost:8081/scm/api/rest/v2/repository-types"
href: "http://localhost:8081/scm/api/rest/v2/repositoryTypes"
}
}
};
@@ -97,7 +97,7 @@ describe("repository types caching", () => {
});
describe("repository types fetch", () => {
const URL = "/scm/api/rest/v2/repository-types";
const URL = "/scm/api/rest/v2/repositoryTypes";
const mockStore = configureMockStore([thunk]);
afterEach(() => {