mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
AddAddress: rename callback method
This commit is contained in:
parent
f66df3b77c
commit
c58d1eccc5
@ -3,7 +3,7 @@
|
||||
v-bind:key="key"
|
||||
v-bind:context="context"
|
||||
v-bind:options="options"
|
||||
v-bind:addressChanged="submitAddress"
|
||||
v-bind:addressChangedCallback="submitAddress"
|
||||
ref="addAddress">
|
||||
</add-address>
|
||||
</template>
|
||||
|
@ -128,7 +128,7 @@ import EditAddressPane from './EditAddressPane.vue';
|
||||
|
||||
export default {
|
||||
name: "AddAddress",
|
||||
props: ['context', 'options', 'addressChanged'],
|
||||
props: ['context', 'options', 'addressChangedCallback'],
|
||||
components: {
|
||||
Modal,
|
||||
ShowAddressPane,
|
||||
@ -413,16 +413,14 @@ export default {
|
||||
})
|
||||
.then(payload => {
|
||||
console.log('payload', payload);
|
||||
this.addressChanged(payload);
|
||||
this.closePaneAndCallbackSubmit(payload);
|
||||
}
|
||||
);
|
||||
|
||||
} else {
|
||||
this.addNewAddress(newAddress)
|
||||
.then(payload => this.addressChanged(payload));
|
||||
.then(payload => this.closePaneAndCallbackSubmit(payload));
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
/*
|
||||
@ -518,24 +516,19 @@ export default {
|
||||
},
|
||||
|
||||
/*
|
||||
* Method called by parent when submitting address
|
||||
* Method just add closing pane to the callback method
|
||||
* (get out step1 show pane, submit button)
|
||||
submitNewAddress()
|
||||
*/
|
||||
closePaneAndCallbackSubmit(payload)
|
||||
{
|
||||
let payload = {
|
||||
entity: this.context.entity.name,
|
||||
entityId: this.context.entity.id,
|
||||
addressId: this.entity.address.address_id
|
||||
};
|
||||
console.log('close pane and call parent callback method', payload);
|
||||
|
||||
console.log('submitNewAddress return', payload);
|
||||
|
||||
this.initForm();
|
||||
//this.initForm();
|
||||
this.flag.showPane = false;
|
||||
|
||||
return payload;
|
||||
// callback props method from parent
|
||||
this.addressChangedCallback(payload);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user