mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-28 01:25:00 +00:00
show household suggestion in household members editor
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
Reference in New Issue
Block a user