mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Confirm post request, change state step and hide components
This commit is contained in:
@@ -13,18 +13,6 @@ const getAccompanyingCourse = (id) => {
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Endpoint
|
||||
*/
|
||||
const getSocialIssues = () => {
|
||||
const url = `/api/1.0/person/social-work/social-issue.json`;
|
||||
return fetch(url)
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw Error('Error with request resource response');
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Endpoint v.2 chill_api_single_accompanying_course__entity
|
||||
* method PATCH, patch AccompanyingCourse Instance
|
||||
@@ -48,6 +36,33 @@ const patchAccompanyingCourse = (id, body) => {
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Endpoint to change 'DRAFT' step to 'CONFIRMED'
|
||||
*/
|
||||
const confirmAccompanyingCourse = (id) => {
|
||||
const url = `/api/1.0/person/accompanying-course/${id}/confirm.json`
|
||||
return fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json;charset=utf-8'}
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw Error('Error with request resource response');
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Endpoint
|
||||
*/
|
||||
const getSocialIssues = () => {
|
||||
const url = `/api/1.0/person/social-work/social-issue.json`;
|
||||
return fetch(url)
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw Error('Error with request resource response');
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Endpoint v.2 chill_api_single_accompanying_course_participation,
|
||||
* method POST/DELETE, add/close a participation to the accompanyingCourse
|
||||
@@ -133,8 +148,9 @@ const postResource = (id, payload, method) => {
|
||||
|
||||
export {
|
||||
getAccompanyingCourse,
|
||||
getSocialIssues,
|
||||
patchAccompanyingCourse,
|
||||
confirmAccompanyingCourse,
|
||||
getSocialIssues,
|
||||
postParticipation,
|
||||
postRequestor,
|
||||
postResource,
|
||||
|
Reference in New Issue
Block a user