Skip to content

Commit

Permalink
Exported connection string to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
AAmanzi committed Jun 6, 2019
1 parent 21ecd42 commit b3e80f4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Frontend/src/services/normalization.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const CONNECTION_PORT_API = "http:https://localhost:58183/api/";

export const postTable = payload => {
return fetch("http:https://localhost:58183/api/schema/post", {
return fetch(`${CONNECTION_PORT_API}schema/post`, {
method: "POST",
mode: "cors",
headers: {
Expand All @@ -12,7 +14,7 @@ export const postTable = payload => {
};

export const updateTable = payload => {
return fetch("http:https://localhost:58183/api/schema/update", {
return fetch(`${CONNECTION_PORT_API}schema/update`, {
method: "PUT",
mode: "cors",
headers: {
Expand All @@ -25,26 +27,26 @@ export const updateTable = payload => {
};

export const fetchStoredTables = () => {
return fetch("http:https://localhost:58183/api/schema/get").then(response =>
return fetch(`${CONNECTION_PORT_API}schema/get`).then(response =>
response.json()
);
};

export const fetchTableById = id => {
return fetch(`http:https://localhost:58183/api/schema/get/${id}`).then(response =>
return fetch(`${CONNECTION_PORT_API}schema/get/${id}`).then(response =>
response.json()
);
};

export const deleteTable = id => {
return fetch(`http:https://localhost:58183/api/schema/delete/${id}`, {
return fetch(`${CONNECTION_PORT_API}schema/delete/${id}`, {
method: "DELETE",
headers: { "Content-Type": "application/json" }
});
};

export const runAlgorithm = id => {
return fetch(`http:https://localhost:58183/api/normalization/generate/${id}`).then(
return fetch(`${CONNECTION_PORT_API}normalization/generate/${id}`).then(
response => response.json()
);
};

0 comments on commit b3e80f4

Please sign in to comment.