mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 14:24:24 +00:00
url's and method changed for toggleIntensity and toggleConfidential
This commit is contained in:
parent
a399804094
commit
ee817b1d62
@ -468,12 +468,12 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
|
|||||||
* Update accompanying course intensity/emergency/confidentiality
|
* Update accompanying course intensity/emergency/confidentiality
|
||||||
*/
|
*/
|
||||||
toggleIntensity({ commit }, payload) {
|
toggleIntensity({ commit }, payload) {
|
||||||
const url = `/api/1.0/person/accompanying-course/${id}.json`
|
const url = `/api/1.0/person/accompanying-course/${id}/intensity.json`
|
||||||
const body = { type: "accompanying_period", 'intensity': payload }
|
const body = { type: "accompanying_period", 'intensity': payload }
|
||||||
|
|
||||||
return makeFetch('PATCH', url, body)
|
return makeFetch('POST', url, body)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
commit('toggleIntensity', response.intensity);
|
commit('toggleIntensity', response);
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@ -495,12 +495,15 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
toggleConfidential({ commit }, payload) {
|
toggleConfidential({ commit }, payload) {
|
||||||
const url = `/api/1.0/person/accompanying-course/${id}.json`
|
const url = `/api/1.0/person/accompanying-course/${id}/confidential.json`
|
||||||
const body = { type: "accompanying_period", confidential: payload }
|
const body = { type: "accompanying_period", confidential: payload }
|
||||||
|
|
||||||
return makeFetch('PATCH', url, body)
|
console.log('url', url)
|
||||||
|
console.log('body', body)
|
||||||
|
|
||||||
|
return makeFetch('POST', url, body)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
commit('toggleConfidential', response.confidential);
|
commit('toggleConfidential', response);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
commit('catchError', error);
|
commit('catchError', error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user