mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 02:25:00 +00:00
rdv: edit calendar ranges: add delete + doc swagger
This commit is contained in:
@@ -38,12 +38,12 @@ const fetchCalendar = (mainUserId) => {
|
||||
|
||||
/*
|
||||
* Endpoint chill_api_single_calendar_range__entity_create
|
||||
* method POST or DELETE, post CalendarRange entity
|
||||
* method POST, post CalendarRange entity
|
||||
*/
|
||||
const postCalendarRange = (body, method) => {
|
||||
const postCalendarRange = (body) => {
|
||||
const url = `/api/1.0/calendar/calendar-range.json?`;
|
||||
return fetch(url, {
|
||||
method: method,
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8'
|
||||
},
|
||||
@@ -73,11 +73,44 @@ const patchCalendarRange = (id, body) => {
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Endpoint chill_api_single_calendar_range__entity
|
||||
* method DELETE, delete CalendarRange entity
|
||||
*/
|
||||
const deleteCalendarRange = (id) => {
|
||||
const url = `/api/1.0/calendar/calendar-range/${id}.json`;
|
||||
return fetch(url, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8'
|
||||
},
|
||||
}).then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw Error('Error with request resource response');
|
||||
});
|
||||
};
|
||||
|
||||
// const deleteCalendarRange = (id) => {
|
||||
// const url = `/api/1.0/calendar/calendar-range.json`;
|
||||
// return fetch(url, {
|
||||
// method: 'DELETE',
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json;charset=utf-8'
|
||||
// },
|
||||
// body: JSON.stringify({
|
||||
// id: id
|
||||
// })
|
||||
// }).then(response => {
|
||||
// if (response.ok) { return response.json(); }
|
||||
// throw Error('Error with request resource response');
|
||||
// });
|
||||
// };
|
||||
|
||||
export {
|
||||
fetchCalendarRanges,
|
||||
fetchCalendar,
|
||||
fetchCalendarRangesByUser,
|
||||
postCalendarRange,
|
||||
patchCalendarRange
|
||||
patchCalendarRange,
|
||||
deleteCalendarRange
|
||||
};
|
||||
|
Reference in New Issue
Block a user