mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 10:23:54 +00:00
refractor + style tweaks
- bugfix on lower - delay between 0-60 minutes - action buttons in dropdown - added button for toggling element visibility - several css and code cleanups - renamed settingsAPI
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import axios from 'axios';
|
||||
import { NODE_PORT } from './apiConstants';
|
||||
|
||||
// get origin from URL
|
||||
const serverURL = window.location.origin.replace(
|
||||
window.location.port,
|
||||
`${NODE_PORT}/`
|
||||
);
|
||||
|
||||
export const eventNamespace = 'event';
|
||||
export const eventURL = serverURL + eventNamespace;
|
||||
|
||||
export const fetchEvent = async () => {
|
||||
const res = await axios.get(eventURL);
|
||||
return res.data;
|
||||
};
|
||||
|
||||
export const postEvent = async (data) => {
|
||||
const res = await axios.post(eventURL, data);
|
||||
return res;
|
||||
};
|
||||
@@ -1,23 +0,0 @@
|
||||
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 settingsNamespace = 'settings';
|
||||
export const settingsURL = serverURL + settingsNamespace;
|
||||
|
||||
export const fetchSettings = async () => {
|
||||
const res = await axios.get(settingsURL);
|
||||
return res.data;
|
||||
};
|
||||
|
||||
export const postSettings = async (data) => {
|
||||
console.log('debug sending', data)
|
||||
console.log('debug await', await axios.post(settingsURL, data))
|
||||
const res = await axios.post(settingsURL, data);
|
||||
return res;
|
||||
};
|
||||
Reference in New Issue
Block a user