diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
index f6d10ec9e..2bb0a32f7 100644
--- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
+++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
@@ -278,7 +278,8 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_POST => true,
- Request::METHOD_HEAD => true
+ Request::METHOD_HEAD => true,
+ Request::METHOD_PATCH => true
]
],
]
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_api/AddAddress.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_api/AddAddress.js
index 383ffb25f..80586a42b 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_api/AddAddress.js
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_api/AddAddress.js
@@ -82,10 +82,37 @@ const postAddress = (address) => {
});
};
+
+/*
+* Endpoint chill_api_single_address__entity__create
+* method PATCH, patch Address Instance
+*
+* @id integer - id of address
+* @body Object - dictionary with changes to post
+*/
+const patchAddress = (id, body) => {
+ console.log('body', body);
+ const url = `/api/1.0/main/address/${id}.json`;
+ return fetch(url, {
+ method: 'PATCH',
+ 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');
+ });
+};
+
+
+
export {
fetchCountries,
fetchCities,
fetchReferenceAddresses,
fetchAddresses,
- postAddress
+ postAddress,
+ patchAddress
};
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue
index ca1f81d42..2dcabcd9d 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue
@@ -4,6 +4,11 @@