mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
prepare to merge HouseholdAddress in Address: split api.js files
This commit is contained in:
parent
9e94cea9d5
commit
9f77b84e48
@ -125,31 +125,6 @@ const postPostalCode = (postalCode) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* Endpoint chill_api_single_person_address
|
|
||||||
* method POST, post Person instance
|
|
||||||
*
|
|
||||||
* @id integer - id of Person
|
|
||||||
* @body Object - dictionary with changes to post
|
|
||||||
*/
|
|
||||||
const postAddressToPerson = (personId, addressId) => {
|
|
||||||
//console.log(personId);
|
|
||||||
//console.log(addressId);
|
|
||||||
const body = {
|
|
||||||
'id': addressId
|
|
||||||
};
|
|
||||||
const url = `/api/1.0/person/person/${personId}/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');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Endpoint chill_api_single_address__index
|
* Endpoint chill_api_single_address__index
|
||||||
* method GET, get Address Object
|
* method GET, get Address Object
|
||||||
@ -174,6 +149,5 @@ export {
|
|||||||
postAddress,
|
postAddress,
|
||||||
patchAddress,
|
patchAddress,
|
||||||
postPostalCode,
|
postPostalCode,
|
||||||
postAddressToPerson,
|
|
||||||
getAddress
|
getAddress
|
||||||
};
|
};
|
||||||
|
@ -117,13 +117,12 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||||
|
import { getAddress, fetchCountries, fetchCities, fetchReferenceAddresses, patchAddress, postAddress, postPostalCode } from '../api';
|
||||||
|
import { postAddressToPerson } from "ChillPersonAssets/vuejs/_api/AddAddress/Person.js";
|
||||||
|
import { postAddressToHousehold } from "ChillPersonAssets/vuejs/_api/AddAddress/Household.js";
|
||||||
import ShowAddress from './ShowAddress.vue';
|
import ShowAddress from './ShowAddress.vue';
|
||||||
import EditAddress from './EditAddress.vue';
|
import EditAddress from './EditAddress.vue';
|
||||||
import {
|
|
||||||
getAddress,
|
|
||||||
fetchCountries, fetchCities, fetchReferenceAddresses,
|
|
||||||
patchAddress, postAddress, postPostalCode, postAddressToPerson
|
|
||||||
} from '../api'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AddAddress",
|
name: "AddAddress",
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Endpoint chill_api_single_person_address
|
||||||
|
* method POST, post Person instance
|
||||||
|
*
|
||||||
|
* @id integer - id of Person
|
||||||
|
* @body Object - dictionary with changes to post
|
||||||
|
*/
|
||||||
|
const postAddressToPerson = (personId, addressId) => {
|
||||||
|
//console.log(personId);
|
||||||
|
//console.log(addressId);
|
||||||
|
const body = {
|
||||||
|
'id': addressId
|
||||||
|
};
|
||||||
|
const url = `/api/1.0/person/person/${personId}/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');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export { postAddressToPerson };
|
@ -8,11 +8,13 @@ module.exports = function(encore, entries)
|
|||||||
ChillPersonAssets: __dirname + '/Resources/public'
|
ChillPersonAssets: __dirname + '/Resources/public'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// will disappear
|
||||||
//encore.addEntry('vue_household_address', __dirname + '/Resources/public/vuejs/HouseholdAddress/index.js');
|
//encore.addEntry('vue_household_address', __dirname + '/Resources/public/vuejs/HouseholdAddress/index.js');
|
||||||
//encore.addEntry('vue_household_members_editor', __dirname + '/Resources/public/vuejs/HouseholdMembersEditor/index.js');
|
|
||||||
|
encore.addEntry('vue_household_members_editor', __dirname + '/Resources/public/vuejs/HouseholdMembersEditor/index.js');
|
||||||
encore.addEntry('vue_accourse', __dirname + '/Resources/public/vuejs/AccompanyingCourse/index.js');
|
encore.addEntry('vue_accourse', __dirname + '/Resources/public/vuejs/AccompanyingCourse/index.js');
|
||||||
//encore.addEntry('vue_accourse_work_create', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkCreate/index.js');
|
encore.addEntry('vue_accourse_work_create', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkCreate/index.js');
|
||||||
//encore.addEntry('vue_accourse_work_edit', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkEdit/index.js');
|
encore.addEntry('vue_accourse_work_edit', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkEdit/index.js');
|
||||||
|
|
||||||
encore.addEntry('page_household_edit_metadata', __dirname + '/Resources/public/page/household_edit_metadata/index.js');
|
encore.addEntry('page_household_edit_metadata', __dirname + '/Resources/public/page/household_edit_metadata/index.js');
|
||||||
encore.addEntry('page_person', __dirname + '/Resources/public/page/person/index.js');
|
encore.addEntry('page_person', __dirname + '/Resources/public/page/person/index.js');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user