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:
Carlos Valente
2022-01-14 22:11:33 +01:00
committed by GitHub
parent acb5d8ae08
commit 79a24a134e
6 changed files with 41 additions and 37 deletions
+8 -15
View File
@@ -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 =