bugfix in resourceItem

when address is null it gave an error and modal wouldn't close
This commit is contained in:
Julie Lenaerts 2022-02-18 16:22:33 +01:00
parent 4920c8b28b
commit 265c8b776b

View File

@ -167,10 +167,13 @@ export default {
})
}
else if (payload.type === 'thirdparty') {
console.log('data', payload.data)
body.name = payload.data.text;
body.email = payload.data.email;
body.telephone = payload.data.phonenumber;
body.address = { id: payload.data.address.address_id };
body.address = payload.data.address ? { id: payload.data.address.address_id } : null;
console.log('body', body)
makeFetch('PATCH', `/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`, body)
.then(response => {