mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch 'issue578_display_userjob' into 'master'
Issue578 display userjob See merge request Chill-Projet/chill-bundles!430
This commit is contained in:
commit
af7df7029b
@ -32,6 +32,7 @@ and this project adheres to
|
|||||||
* [person] add maritalStatusComment to PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/582)
|
* [person] add maritalStatusComment to PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/582)
|
||||||
* Load relationships without gender in french fixtures
|
* Load relationships without gender in french fixtures
|
||||||
* Add command to remove old draft accompanying periods
|
* Add command to remove old draft accompanying periods
|
||||||
|
* [parcours]: If users assings him/herself as referrer and job is not null. Update parcours job (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/578)
|
||||||
|
|
||||||
### 2021-04-28
|
### 2021-04-28
|
||||||
|
|
||||||
|
@ -253,7 +253,6 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
|
|||||||
state.accompanyingCourse.administrativeLocation = value;
|
state.accompanyingCourse.administrativeLocation = value;
|
||||||
},
|
},
|
||||||
updateReferrer(state, value) {
|
updateReferrer(state, value) {
|
||||||
//console.log('value', value);
|
|
||||||
state.accompanyingCourse.user = value;
|
state.accompanyingCourse.user = value;
|
||||||
},
|
},
|
||||||
updateJob(state, value) {
|
updateJob(state, value) {
|
||||||
@ -775,9 +774,7 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
|
|||||||
throw error;
|
throw error;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateReferrer({ commit }, payload) {
|
updateReferrer({ commit, state }, payload) {
|
||||||
console.log('update referrer', payload);
|
|
||||||
console.log('payload !== null', payload !== null);
|
|
||||||
const url = `/api/1.0/person/accompanying-course/${id}.json`;
|
const url = `/api/1.0/person/accompanying-course/${id}.json`;
|
||||||
let body = { type: "accompanying_period", user: null };
|
let body = { type: "accompanying_period", user: null };
|
||||||
|
|
||||||
@ -788,7 +785,10 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
|
|||||||
return makeFetch('PATCH', url, body)
|
return makeFetch('PATCH', url, body)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
commit('updateReferrer', response.user);
|
commit('updateReferrer', response.user);
|
||||||
commit('setFilteredReferrersSuggested');
|
if (null !== payload.user_job && payload.user_job !== state.accompanyingCourse.job) {
|
||||||
|
this.dispatch('updateJob', payload.user_job);
|
||||||
|
}
|
||||||
|
// commit('setFilteredReferrersSuggested'); // this mutation doesn't exist?
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
commit('catchError', error);
|
commit('catchError', error);
|
||||||
@ -799,6 +799,8 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
|
|||||||
const url = `/api/1.0/person/accompanying-course/${id}.json`;
|
const url = `/api/1.0/person/accompanying-course/${id}.json`;
|
||||||
let body = { type: "accompanying_period", job: null };
|
let body = { type: "accompanying_period", job: null };
|
||||||
|
|
||||||
|
console.log('update job', payload);
|
||||||
|
|
||||||
if (payload !== null) {
|
if (payload !== null) {
|
||||||
body = { type: "accompanying_period", job: { id: payload.id, type: payload.type } };
|
body = { type: "accompanying_period", job: { id: payload.id, type: payload.type } };
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user