mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 19:03:47 +00:00
Hotfix/6.0.2 (#94)
* hotfix/6.0.2 fix issue where events could not have an ID * hotfix/6.0.2 version bump * hotfix/6.0.2 testing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import axios from 'axios';
|
||||
import { eventsURL } from '../api/apiConstants';
|
||||
import { eventsURL } from './apiConstants';
|
||||
|
||||
export const fetchAllEvents = async () => {
|
||||
const res = await axios.get(eventsURL);
|
||||
@@ -7,38 +7,31 @@ export const fetchAllEvents = async () => {
|
||||
};
|
||||
|
||||
export const requestPost = async (data) => {
|
||||
const res = await axios.post(eventsURL, data);
|
||||
return res;
|
||||
return await axios.post(eventsURL, data);
|
||||
};
|
||||
|
||||
export const requestPut = async (data) => {
|
||||
const res = await axios.put(eventsURL, data);
|
||||
return res;
|
||||
return await axios.put(eventsURL, data);
|
||||
};
|
||||
|
||||
export const requestPatch = async (data) => {
|
||||
const res = await axios.patch(eventsURL, data);
|
||||
return res;
|
||||
return await axios.patch(eventsURL, data);
|
||||
};
|
||||
|
||||
export const requestReorder = async (data) => {
|
||||
const action = 'reorder';
|
||||
const res = await axios.patch(eventsURL + '/' + action, data);
|
||||
return res;
|
||||
return await axios.patch(eventsURL + '/' + action, data);
|
||||
};
|
||||
|
||||
export const requestApplyDelay = async (eventId) => {
|
||||
const action = 'applydelay';
|
||||
const res = await axios.patch(eventsURL + '/' + action + '/' + eventId);
|
||||
return res;
|
||||
return await axios.patch(eventsURL + '/' + action + '/' + eventId);
|
||||
};
|
||||
|
||||
export const requestDelete = async (eventId) => {
|
||||
const res = await axios.delete(eventsURL + '/' + eventId);
|
||||
return res;
|
||||
return await axios.delete(eventsURL + '/' + eventId);
|
||||
};
|
||||
|
||||
export const requestDeleteAll = async () => {
|
||||
const res = await axios.delete(eventsURL + '/all');
|
||||
return res;
|
||||
return await axios.delete(eventsURL + '/all');
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@ import PropTypes from 'prop-types';
|
||||
const ExpandedBlock = (props) => {
|
||||
const { provided, data, eventIndex, next, delay, delayValue, previousEnd, actionHandler } = props;
|
||||
|
||||
const oscid = data.id.length > 4 ? '...' : data.id;
|
||||
const oscid = data?.id || '...';
|
||||
|
||||
// if end is before, assume is the day after
|
||||
const duration =
|
||||
|
||||
Reference in New Issue
Block a user