AddAddress: rename callback method

This commit is contained in:
Mathieu Jaumotte 2021-09-16 20:49:46 +02:00
parent f66df3b77c
commit c58d1eccc5
2 changed files with 11 additions and 18 deletions

View File

@ -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>

View File

@ -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>