mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
24 lines
661 B
JavaScript
24 lines
661 B
JavaScript
/*
|
|
* Endpoint household
|
|
* method POST, post Household instance
|
|
*
|
|
* @id integer - id of household
|
|
* @body Object - dictionary with changes to post
|
|
*/
|
|
export const postAddressToHousehold = (householdId, addressId) => {
|
|
const body = {
|
|
'id': addressId
|
|
};
|
|
const url = `/api/1.0/person/household/${householdId}/address.json`
|
|
return fetch(url, {
|
|
method: 'POST',
|
|
headers: {'Content-Type': 'application/json;charset=utf-8'},
|
|
body: JSON.stringify(body)
|
|
})
|
|
.then(response => {
|
|
if (response.ok) { return response.json(); }
|
|
throw Error('Error with request resource response');
|
|
});
|
|
};
|
|
|