mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-02 19:39:45 +00:00
address form: add the possibility to create a new address
This commit is contained in:
@@ -33,20 +33,25 @@ export default {
|
||||
methods: {
|
||||
addNewAddress({ address, modal }) {
|
||||
console.log('@@@ CLICK button addNewAdress', address);
|
||||
const newAddress = {
|
||||
|
||||
let newAddress = {
|
||||
'isNoAddress': address.isNoAddress,
|
||||
'street': address.selected.address.street,
|
||||
'streetNumber': address.selected.address.streetNumber,
|
||||
'postcode': {'id': address.selected.address.postcode.id},
|
||||
'postcode': {'id': address.selected.city.id },
|
||||
'floor': address.floor,
|
||||
'corridor': address.corridor,
|
||||
'steps': address.steps,
|
||||
'flat': address.flat,
|
||||
'buildingName': address.buildingName,
|
||||
'distribution': address.distribution,
|
||||
'extra': address.extra,
|
||||
'point': address.selected.address.point.coordinates
|
||||
'extra': address.extra
|
||||
};
|
||||
|
||||
if (address.selected.address.point !== undefined){
|
||||
newAddress = Object.assign(newAddress, {'point': address.selected.address.point.coordinates});
|
||||
}
|
||||
|
||||
this.$store.dispatch('addAddress', newAddress);
|
||||
modal.showModal = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user