From 4047399b76bf70aec680d23d9d4ba0775c361efd Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 30 Sep 2021 21:22:28 +0200 Subject: [PATCH] otf: comments to remember things to improve --- .../public/vuejs/_components/OnTheFly/ThirdParty.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue index 6d28db7c9..21b79a1c7 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -68,7 +68,7 @@ export default { }, data() { return { - //context: {}, + //context: {}, <-- thirdparty: { type: 'thirdparty' }, @@ -104,7 +104,7 @@ export default { context.edit = true; } console.log('context', context); - //this.context = context; + //this.context = context; <-- return context; }, }, @@ -114,6 +114,7 @@ export default { this.thirdparty = thirdparty; console.log('get thirdparty', thirdparty); if (this.action !== 'show') { + // bof! we force getInitialAddress because addressId not available when mounted this.$refs.addAddress.getInitialAddress(thirdparty.address.address_id); } resolve(); @@ -121,11 +122,11 @@ export default { }, submitAddress(payload) { console.log('submitAddress', payload); - if (typeof payload.addressId !== 'undefined') { + if (typeof payload.addressId !== 'undefined') { // <-- this.context.edit = true; - this.context.addressId = payload.addressId; + this.context.addressId = payload.addressId; // bof! use legacy and not legacy in payload + this.thirdparty.address = payload.address; // <-- console.log('switch address to edit mode', this.context); - this.thirdparty.address = payload.address; } } },