[Household members editor] add address suggestion on menage creation

This commit is contained in:
2021-08-16 19:07:03 +02:00
parent 25465b1121
commit 5a716a3523
7 changed files with 568 additions and 14 deletions

View File

@@ -37,7 +37,20 @@ const fetchHouseholdSuggestionByAccompanyingPeriod = (personId) => {
;
};
const fetchAddressSuggestionByPerson = (personId) => {
const url = `/api/1.0/person/address/suggest/by-person/${personId}.json`;
return window.fetch(url)
.then(response => {
if (response.ok) {
return response.json();
}
throw Error({m: 'Error while fetch address suggestion', status: response.status});
});
}
export {
householdMove,
fetchHouseholdSuggestionByAccompanyingPeriod,
fetchAddressSuggestionByPerson,
};