remove the rest/ path from endpoints

This commit is contained in:
Mohamed Karray
2018-10-01 17:22:03 +02:00
parent cd621ded81
commit b33b72aa80
20 changed files with 126 additions and 114 deletions

View File

@@ -23,7 +23,7 @@ import reducer, {
getConfigUpdatePermission
} from "./config";
const CONFIG_URL = "/api/rest/v2/config";
const CONFIG_URL = "/api/v2/config";
const error = new Error("You have an error!");
@@ -51,8 +51,8 @@ const config = {
enabledXsrfProtection: true,
defaultNamespaceStrategy: "sonia.scm.repository.DefaultNamespaceStrategy",
_links: {
self: { href: "http://localhost:8081/api/rest/v2/config" },
update: { href: "http://localhost:8081/api/rest/v2/config" }
self: { href: "http://localhost:8081/api/v2/config" },
update: { href: "http://localhost:8081/api/v2/config" }
}
};
@@ -80,8 +80,8 @@ const configWithNullValues = {
enabledXsrfProtection: true,
defaultNamespaceStrategy: "sonia.scm.repository.DefaultNamespaceStrategy",
_links: {
self: { href: "http://localhost:8081/api/rest/v2/config" },
update: { href: "http://localhost:8081/api/rest/v2/config" }
self: { href: "http://localhost:8081/api/v2/config" },
update: { href: "http://localhost:8081/api/v2/config" }
}
};
@@ -135,7 +135,7 @@ describe("config fetch()", () => {
});
it("should successfully modify config", () => {
fetchMock.putOnce("http://localhost:8081/api/rest/v2/config", {
fetchMock.putOnce("http://localhost:8081/api/v2/config", {
status: 204
});
@@ -150,7 +150,7 @@ describe("config fetch()", () => {
});
it("should call the callback after modifying config", () => {
fetchMock.putOnce("http://localhost:8081/api/rest/v2/config", {
fetchMock.putOnce("http://localhost:8081/api/v2/config", {
status: 204
});
@@ -169,7 +169,7 @@ describe("config fetch()", () => {
});
it("should fail modifying config on HTTP 500", () => {
fetchMock.putOnce("http://localhost:8081/api/rest/v2/config", {
fetchMock.putOnce("http://localhost:8081/api/v2/config", {
status: 500
});