show household suggestion in household members editor

This commit is contained in:
2021-06-28 00:35:40 +02:00
parent a8bf478ee8
commit 9aa3974071
4 changed files with 146 additions and 2 deletions

View File

@@ -23,6 +23,21 @@ const householdMove = (payload) => {
});
};
const fetchHouseholdSuggestionByAccompanyingPeriod = (personId) => {
const url = `/api/1.0/person/household/suggest/by-person/${personId}/through-accompanying-period-participation.json`;
return window.fetch(url)
.then(response => {
if (response.ok) {
return response.json();
}
throw Error ({m: 'Error while fetching household suggestion', status: response.status});
}).then(data => Promise.resolve(data.results))
.catch(e => console.err(e));
;
};
export {
householdMove,
fetchHouseholdSuggestionByAccompanyingPeriod,
};