diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue index 5e57ae93d..3c1cd52b1 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue @@ -291,13 +291,10 @@ export default { 'type': 'household' }; const address = { - 'type': 'address', 'id': data.addressId }; makeFetch('POST', '/api/1.0/person/household.json', household) .then(responseHousehold => { - console.log(responseHousehold); - const member = { 'concerned': [ { @@ -305,25 +302,27 @@ export default { 'type': 'person', 'id': responsePerson.id }, - "position": { + 'position': { "type": "household_position", "id": 4 //TODO, which position? }, + 'start_date': { + 'datetime': `${new Date().toISOString().split('T')[0]}T00:00:00+02:00` + }, + 'holder': false, //TODO true or false? + 'comment': null } ], 'destination': { 'type': 'household', 'id': responseHousehold.id - } + }, + 'composition': null }; - console.log(member); makeFetch('POST', '/api/1.0/person/household/members/move.json', member) - .then(response => { - console.log(response); + .then(_response => { makeFetch('POST', `/api/1.0/person/household/${responseHousehold.id}/address.json`, address) - .then(response => { - console.log(response); - }) + .then(_response => {}) .catch((error) => { if (error.name === 'ValidationException') { for (let v of error.violations) {