refract: cleanup server call constants

This commit is contained in:
cv
2021-05-16 22:41:43 +02:00
parent b42710a972
commit 8162c622a6
8 changed files with 46 additions and 60 deletions
+1 -10
View File
@@ -1,14 +1,5 @@
import axios from 'axios';
import { NODE_PORT } from '../api/apiConstants';
// get origin from URL
const serverURL = window.location.origin.replace(
window.location.port,
`${NODE_PORT}/`
);
export const eventsNamespace = 'events';
export const eventsURL = serverURL + eventsNamespace;
import { eventsURL } from '../api/apiConstants';
export const fetchAllEvents = async () => {
const res = await axios.get(eventsURL);