@wikala/spmkt 2.31.0 → 3.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION_GUIDE.md +261 -0
- package/api/product.js +1 -0
- package/api/request.js +9 -4
- package/api/user.js +1 -1
- package/components/Account/AccountDashboard.vue +101 -101
- package/components/Account/AccountStore.js +57 -31
- package/components/Account/AffiliateReport.vue +56 -60
- package/components/Account/{OrderDetail.vue → Orders/OrderDetail.vue} +44 -30
- package/components/Account/Orders/Orders.vue +124 -0
- package/components/Account/{AccountSettings.vue → Settings/AccountSettings.vue} +4 -4
- package/components/Account/Settings/ChangeEmail.vue +136 -0
- package/components/Account/Settings/ChangeName.vue +82 -0
- package/components/Account/Settings/ChangePassword.vue +91 -0
- package/components/Address/Address.vue +38 -57
- package/components/Address/AddressBook.vue +77 -57
- package/components/Address/AddressSelect.vue +94 -87
- package/components/Address/Edit.vue +253 -265
- package/components/Address/PostalCode.vue +22 -21
- package/components/AgeGate.vue +11 -5
- package/components/Auth/Login.vue +62 -44
- package/components/Auth/Register.vue +82 -60
- package/components/Auth/ResetPassword.vue +45 -30
- package/components/Cart/AgeVerification/AgeChecker.vue +3 -3
- package/components/Cart/CartBadge.vue +15 -4
- package/components/Cart/CartBox.vue +19 -11
- package/components/Cart/CartItem.vue +3 -3
- package/components/Cart/CartMode.vue +6 -5
- package/components/Cart/CartPreview.vue +24 -18
- package/components/Cart/Coupon.vue +4 -5
- package/components/Cart/CreditCard/Everyware.vue +10 -10
- package/components/Cart/CreditCard/ExtendedCreditCard.vue +5 -5
- package/components/Cart/CreditCard/SquarePay.vue +18 -16
- package/components/Cart/CreditCard/StandardCreditCard.vue +9 -9
- package/components/Cart/Delivery/Delivery.vue +16 -12
- package/components/Cart/Delivery/DeliveryAddress.vue +1 -1
- package/components/Cart/Delivery/DeliveryMethods.vue +1 -1
- package/components/Cart/Delivery/DeliveryOptions.vue +15 -9
- package/components/Cart/Delivery/DeliveryTypes.vue +8 -5
- package/components/Cart/Delivery/ReservationSlots.vue +14 -8
- package/components/Cart/Disclaimer.vue +1 -1
- package/components/Cart/OrderConfirmation.vue +1 -1
- package/components/Cart/Payment/Payment.vue +37 -33
- package/components/Cart/Payment/PaymentMethods.vue +6 -4
- package/components/Cart/ReviewAndSubmit.vue +9 -7
- package/components/Cart/ShoppingCart.vue +42 -31
- package/components/Cart/Store/actions.js +1 -1
- package/components/Cart/Store/getters.js +2 -1
- package/components/Cart/Store/index.js +1 -1
- package/components/Cart/Store/mutations.js +7 -5
- package/components/Cart/UserIdentity.vue +1 -1
- package/components/Category/CategoryFilter.vue +128 -114
- package/components/Category/CategorySort.vue +44 -32
- package/components/Category/LoadMore.vue +39 -23
- package/components/DeliverTo.vue +10 -15
- package/components/DeliveryNotice.vue +72 -68
- package/components/DobInput.vue +23 -23
- package/components/Gmaps/GmapsAutocomplete.vue +139 -78
- package/components/Gmaps/GmapsLocations.vue +1 -1
- package/components/Gmaps/GmapsSingleLocation.vue +121 -87
- package/components/ModalContainer/ModalContainer.vue +12 -9
- package/components/ModalContainer/index.js +61 -18
- package/components/Product/AddToCart.vue +237 -221
- package/components/Product/BoxAddToCart.vue +114 -86
- package/components/Product/Compare.vue +68 -48
- package/components/Product/CompareBox.vue +128 -123
- package/components/Product/Lookup.vue +92 -65
- package/components/Product/Photo.vue +105 -66
- package/components/Product/Price.vue +64 -43
- package/components/Product/ProductAutocomplete.vue +52 -57
- package/components/Product/ProductBox.vue +61 -38
- package/components/Product/ProductImages.vue +83 -86
- package/components/Product/Quantity.vue +115 -53
- package/components/Product/QuickView.vue +52 -45
- package/components/Product/RelatedProducts.vue +88 -23
- package/components/Product/SKU.vue +27 -8
- package/components/Product/Variants.vue +335 -341
- package/components/Product/reviews-questions/ProductQuestions.vue +226 -198
- package/components/Product/reviews-questions/ProductReviews.vue +122 -107
- package/components/Product/reviews-questions/Review.vue +54 -59
- package/components/Product/reviews-questions/ReviewForm.vue +222 -170
- package/components/Product/reviews-questions/ReviewImages.vue +197 -216
- package/components/Product/reviews-questions/Vote.vue +83 -57
- package/components/QuantityInput.vue +18 -8
- package/components/RangeInput.vue +15 -8
- package/components/Recaptcha.vue +8 -1
- package/components/SelectShippingCountry.vue +81 -62
- package/components/TimedOffer.vue +59 -74
- package/composables/globals.js +53 -0
- package/config.js +5 -2
- package/index.js +41 -10
- package/install.js +75 -0
- package/locales/en.json +2 -1
- package/locales/sr.json +2 -1
- package/package.json +43 -30
- package/utils/directives.js +28 -45
- package/utils/event-bus.js +56 -0
- package/utils/filters.js +24 -7
- package/utils/{gmaps.js → google/gmaps.js} +43 -10
- package/utils/{google-analytics-eec.js → google/google-analytics-eec.js} +7 -7
- package/babel.config.js +0 -5
- package/components/Account/ChangeEmail.vue +0 -133
- package/components/Account/ChangeName.vue +0 -92
- package/components/Account/ChangePassword.vue +0 -94
- package/components/Account/CreditCards.vue +0 -18
- package/components/Account/Orders.vue +0 -110
- package/components/Account/Settings.vue +0 -18
- package/components/Cart/Delivery/DeliveryAddressGuest.spec.js +0 -128
- package/components/Cart/Delivery/DeliveryTypes.spec.js +0 -83
- package/components/Cart/PCIBadge/SecurityMetrics.vue +0 -11
- package/components/Instagram.vue +0 -49
- package/components/ProductImageModal.vue +0 -41
- package/jest.config.js +0 -16
- package/test/e2e/.babelrc.js +0 -8
- package/test/e2e/.eslintrc.js +0 -11
- package/test/e2e/accAuth.spec.js +0 -64
- package/test/e2e/ageGate.spec.js +0 -26
- package/test/e2e/checkout.spec.js +0 -106
- package/test/e2e/compare.spec.js +0 -52
- package/test/e2e/config/data.js +0 -21
- package/test/e2e/config/routes.js +0 -11
- package/test/e2e/region.spec.js +0 -46
- package/test/e2e/search.spec.js +0 -32
- package/tests/vueBuefy.js +0 -4
- package/tsconfig.json +0 -8
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="password-wrapper column-wrapper">
|
|
3
|
+
<div class="password-header">
|
|
4
|
+
<p>Password</p>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="columns-wrapper">
|
|
7
|
+
<div class="columns is-gapless">
|
|
8
|
+
<div class="column is-one-third">
|
|
9
|
+
<b-field
|
|
10
|
+
:label="$t('account.lCurrentPassword')"
|
|
11
|
+
label-position="inside"
|
|
12
|
+
:type="{ 'is-danger': errors.current_password }"
|
|
13
|
+
:message="errors.current_password"
|
|
14
|
+
>
|
|
15
|
+
<b-input type="password" native-value="inside" v-model="user.current_password" @update:model-value="clearError('current_password')"></b-input>
|
|
16
|
+
</b-field>
|
|
17
|
+
|
|
18
|
+
<b-field :label="$t('account.lNewPassword')" label-position="inside" :type="{ 'is-danger': errors.new_password }" :message="errors.new_password">
|
|
19
|
+
<b-input type="password" native-value="inside" v-model="user.new_password" @update:model-value="clearError('new_password')"></b-input>
|
|
20
|
+
</b-field>
|
|
21
|
+
|
|
22
|
+
<b-field :label="$t('account.lConfirmNewPassword')" label-position="inside">
|
|
23
|
+
<b-input type="password" native-value="inside" v-model="user.new_password_confirmation" @update:model-value="clearError('new_password')"></b-input>
|
|
24
|
+
</b-field>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div class="column"></div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<button type="button" @click="warningMessage" class="button is-primary change-password">{{ $t('account.changePassword') }}</button>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup>
|
|
36
|
+
import { ref } from 'vue'
|
|
37
|
+
import { useBuefy, useT } from '../../../composables/globals'
|
|
38
|
+
import { User } from '../../../api'
|
|
39
|
+
|
|
40
|
+
const { t: $t } = useT()
|
|
41
|
+
const $buefy = useBuefy()
|
|
42
|
+
|
|
43
|
+
const errors = ref({})
|
|
44
|
+
const user = ref({
|
|
45
|
+
current_password: '',
|
|
46
|
+
new_password: '',
|
|
47
|
+
new_password_confirmation: ''
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const submit = () => {
|
|
51
|
+
User.updatePassword(user.value)
|
|
52
|
+
.then((response) => {
|
|
53
|
+
if (response.status === 200 || response.status === 201) {
|
|
54
|
+
$buefy.toast.open({
|
|
55
|
+
message: $t('account.passwordChangedNotification'),
|
|
56
|
+
type: 'is-success'
|
|
57
|
+
})
|
|
58
|
+
} else {
|
|
59
|
+
$buefy.dialog.alert({
|
|
60
|
+
title: $t('account.dialogTitle'),
|
|
61
|
+
message: $t('account.passwordChangeErrorNotification'),
|
|
62
|
+
confirmText: 'OK',
|
|
63
|
+
type: 'is-info'
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
.catch((error) => {
|
|
68
|
+
if (error.errors !== undefined) {
|
|
69
|
+
errors.value = error.errors
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const clearError = (field) => {
|
|
75
|
+
if (errors.value[field]) {
|
|
76
|
+
errors.value[field] = ''
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const warningMessage = () => {
|
|
81
|
+
$buefy.dialog.confirm({
|
|
82
|
+
title: $t('account.dialogTitle'),
|
|
83
|
+
message: $t('account.passwordChangeConfirm'),
|
|
84
|
+
confirmText: 'Ok',
|
|
85
|
+
type: 'is-info',
|
|
86
|
+
onConfirm: () => {
|
|
87
|
+
submit()
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
</script>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
><span v-if="addressData.state && addressData.state.abbr">, {{ addressData.state.abbr }}</span
|
|
9
9
|
><span v-if="addressData.postcode">, {{ addressData.postcode }}</span>
|
|
10
10
|
</div>
|
|
11
|
-
<p>{{
|
|
11
|
+
<p>{{ addressData.country?.name }}</p>
|
|
12
12
|
<p v-if="addressData.phone">{{ $t('address.phoneNumber') }} {{ addressData.phone }}</p>
|
|
13
13
|
</div>
|
|
14
14
|
<div v-if="actionsEnabled" class="buttons-container">
|
|
@@ -36,28 +36,16 @@
|
|
|
36
36
|
{{ $t('global.setAsDefault') }}
|
|
37
37
|
</a>
|
|
38
38
|
</div>
|
|
39
|
-
<b-modal class="modal" :active="showEditAddress" @close="showEditAddress = false" :can-cancel="['x']">
|
|
40
|
-
<EditAddress
|
|
41
|
-
:title="$t('address.title')"
|
|
42
|
-
context="context"
|
|
43
|
-
:countries="countries"
|
|
44
|
-
:address-data="refreshAddressData"
|
|
45
|
-
:show-footer="true"
|
|
46
|
-
@saved="onAddressSaved"
|
|
47
|
-
>
|
|
48
|
-
</EditAddress>
|
|
49
|
-
</b-modal>
|
|
50
39
|
</div>
|
|
51
40
|
</template>
|
|
52
41
|
|
|
53
42
|
<script>
|
|
54
|
-
import
|
|
43
|
+
import { ref } from 'vue'
|
|
44
|
+
import { useBuefy, useT } from '../../composables/globals'
|
|
55
45
|
|
|
56
46
|
export default {
|
|
57
47
|
name: 'Address',
|
|
58
48
|
|
|
59
|
-
components: { EditAddress },
|
|
60
|
-
|
|
61
49
|
props: {
|
|
62
50
|
repository: {
|
|
63
51
|
type: Object,
|
|
@@ -85,52 +73,40 @@ export default {
|
|
|
85
73
|
}
|
|
86
74
|
},
|
|
87
75
|
|
|
88
|
-
|
|
89
|
-
return {
|
|
90
|
-
showEditAddress: false,
|
|
91
|
-
loading: '',
|
|
92
|
-
refreshAddressData: {}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
76
|
+
emits: ['select', 'edit', 'deleted'],
|
|
95
77
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
this.$emit('saved', address)
|
|
100
|
-
},
|
|
78
|
+
setup(props, { emit }) {
|
|
79
|
+
const $buefy = useBuefy()
|
|
80
|
+
const { t: $t } = useT()
|
|
101
81
|
|
|
102
|
-
|
|
82
|
+
const loading = ref('')
|
|
83
|
+
|
|
84
|
+
const editAddress = (id, event) => {
|
|
103
85
|
if (!id) {
|
|
104
86
|
return
|
|
105
87
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
this.repository.get(id).then((response) => {
|
|
110
|
-
this.loading = ''
|
|
111
|
-
;(this.refreshAddressData = response.data.data), (this.showEditAddress = true)
|
|
112
|
-
})
|
|
113
|
-
*/
|
|
114
|
-
},
|
|
88
|
+
// The parent (AddressBook, AddressSelect) fetches the address and opens its own edit modal
|
|
89
|
+
emit('edit', id, event.target)
|
|
90
|
+
}
|
|
115
91
|
|
|
116
|
-
deleteAddress(id) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
title:
|
|
120
|
-
message:
|
|
92
|
+
const deleteAddress = (id) => {
|
|
93
|
+
loading.value = 'delete'
|
|
94
|
+
$buefy.dialog.confirm({
|
|
95
|
+
title: $t('address.confirmTitle'),
|
|
96
|
+
message: $t('address.confirmDelete'),
|
|
121
97
|
onConfirm: () => {
|
|
122
|
-
|
|
98
|
+
props.repository
|
|
123
99
|
.delete(id)
|
|
124
100
|
.then(() => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
101
|
+
loading.value = ''
|
|
102
|
+
$buefy.toast.open($t('address.deletedNotification'))
|
|
103
|
+
emit('deleted')
|
|
128
104
|
})
|
|
129
105
|
.catch((error) => {
|
|
130
|
-
|
|
131
|
-
|
|
106
|
+
loading.value = ''
|
|
107
|
+
$buefy.toast.open({
|
|
132
108
|
duration: 10000,
|
|
133
|
-
message:
|
|
109
|
+
message: $t('global.error') + error.statusText,
|
|
134
110
|
position: 'is-top',
|
|
135
111
|
type: 'is-danger'
|
|
136
112
|
})
|
|
@@ -138,23 +114,28 @@ export default {
|
|
|
138
114
|
})
|
|
139
115
|
},
|
|
140
116
|
onCancel: () => {
|
|
141
|
-
|
|
117
|
+
loading.value = ''
|
|
142
118
|
}
|
|
143
119
|
})
|
|
144
|
-
}
|
|
120
|
+
}
|
|
145
121
|
|
|
146
|
-
setDefault(id) {
|
|
147
|
-
|
|
148
|
-
|
|
122
|
+
const setDefault = (id) => {
|
|
123
|
+
props.repository.setDefault(id).then(() => {
|
|
124
|
+
$buefy.toast.open({
|
|
149
125
|
duration: 10000,
|
|
150
|
-
message:
|
|
126
|
+
message: $t('address.setAsDefaultNotification'),
|
|
151
127
|
position: 'is-top',
|
|
152
128
|
type: 'is-success'
|
|
153
129
|
})
|
|
154
130
|
})
|
|
155
131
|
}
|
|
156
|
-
},
|
|
157
132
|
|
|
158
|
-
|
|
133
|
+
return {
|
|
134
|
+
loading,
|
|
135
|
+
editAddress,
|
|
136
|
+
deleteAddress,
|
|
137
|
+
setDefault
|
|
138
|
+
}
|
|
139
|
+
}
|
|
159
140
|
}
|
|
160
141
|
</script>
|
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
|
-
<b-modal v-model="showEditAddressDialog" class="wkl-modal-container">
|
|
22
|
-
<div class="edit-address-container">
|
|
21
|
+
<b-modal v-model="showEditAddressDialog" class="wkl-modal-container edit-address-modal" has-modal-card :can-cancel="['escape', 'outside']">
|
|
22
|
+
<div class="modal-card edit-address-container">
|
|
23
23
|
<header class="modal-card-head">
|
|
24
24
|
<p class="modal-card-title">{{ addressData.id ? $t('address.title') : $t('address.add') }}</p>
|
|
25
|
+
<button type="button" class="modal-close is-large" :aria-label="$t('global.close')" @click="showEditAddressDialog = false"></button>
|
|
25
26
|
</header>
|
|
26
|
-
<section class="edit-address">
|
|
27
|
+
<section class="modal-card-body edit-address">
|
|
27
28
|
<EditAddress
|
|
28
29
|
:countries="countries"
|
|
29
30
|
:address-data="addressData"
|
|
@@ -41,16 +42,24 @@
|
|
|
41
42
|
</template>
|
|
42
43
|
|
|
43
44
|
<script>
|
|
44
|
-
|
|
45
|
-
import
|
|
45
|
+
import { ref, onMounted } from 'vue'
|
|
46
|
+
import { useBuefy, useT } from '../../composables/globals'
|
|
47
|
+
import gmaps from '../../utils/google/gmaps'
|
|
46
48
|
import { Address as AddressRepository } from '../../api'
|
|
49
|
+
import { eventBus } from '../../utils/event-bus'
|
|
47
50
|
|
|
48
|
-
import Address from './Address'
|
|
49
|
-
import EditAddress from './Edit'
|
|
50
|
-
import addressSchema from './address.schema'
|
|
51
|
+
import Address from './Address.vue'
|
|
52
|
+
import EditAddress from './Edit.vue'
|
|
53
|
+
import { addressSchema } from './address.schema'
|
|
51
54
|
|
|
52
55
|
export default {
|
|
53
56
|
name: 'AddressBook',
|
|
57
|
+
|
|
58
|
+
components: {
|
|
59
|
+
Address,
|
|
60
|
+
EditAddress
|
|
61
|
+
},
|
|
62
|
+
|
|
54
63
|
props: {
|
|
55
64
|
countries: {
|
|
56
65
|
type: Array,
|
|
@@ -63,89 +72,100 @@ export default {
|
|
|
63
72
|
default: false
|
|
64
73
|
}
|
|
65
74
|
},
|
|
66
|
-
components: {
|
|
67
|
-
Address,
|
|
68
|
-
EditAddress
|
|
69
|
-
},
|
|
70
75
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
validationErrors: {},
|
|
77
|
-
showEditAddressDialog: false
|
|
78
|
-
}
|
|
79
|
-
},
|
|
76
|
+
emits: ['saved'],
|
|
77
|
+
|
|
78
|
+
setup(props, { emit }) {
|
|
79
|
+
const $buefy = useBuefy()
|
|
80
|
+
const { t: $t } = useT()
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
// Reactive state
|
|
83
|
+
const addressRepository = AddressRepository
|
|
84
|
+
const addresses = ref([])
|
|
85
|
+
const addressData = ref({ ...addressSchema })
|
|
86
|
+
const validationErrors = ref({})
|
|
87
|
+
const showEditAddressDialog = ref(false)
|
|
88
|
+
|
|
89
|
+
// Methods
|
|
90
|
+
const getAddresses = () => {
|
|
83
91
|
AddressRepository.getList().then((response) => {
|
|
84
|
-
|
|
92
|
+
addresses.value = response.data.data
|
|
85
93
|
})
|
|
86
|
-
}
|
|
94
|
+
}
|
|
87
95
|
|
|
88
|
-
addAddress() {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
96
|
+
const addAddress = () => {
|
|
97
|
+
addressData.value = { ...addressSchema }
|
|
98
|
+
showEditAddressDialog.value = true
|
|
99
|
+
}
|
|
92
100
|
|
|
93
|
-
async
|
|
101
|
+
const editAddress = async (pl, button) => {
|
|
94
102
|
button.classList.add('is-loading')
|
|
95
103
|
try {
|
|
96
104
|
let resp = await AddressRepository.get(pl)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
} catch (e)
|
|
100
|
-
|
|
105
|
+
addressData.value = resp.data.data
|
|
106
|
+
showEditAddressDialog.value = true
|
|
107
|
+
} catch (e) {
|
|
108
|
+
$buefy.toast.open({
|
|
101
109
|
message: 'Cannot get address data',
|
|
102
110
|
type: 'is-error'
|
|
103
111
|
})
|
|
104
112
|
} finally {
|
|
105
113
|
button.classList.remove('is-loading')
|
|
106
114
|
}
|
|
107
|
-
}
|
|
115
|
+
}
|
|
108
116
|
|
|
109
|
-
async
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
const setCoordinates = async () => {
|
|
118
|
+
addressData.value.coordinates = await gmaps.geocodeAddress(
|
|
119
|
+
AddressRepository.getFormatted(addressData.value)
|
|
120
|
+
)
|
|
121
|
+
}
|
|
112
122
|
|
|
113
|
-
async
|
|
114
|
-
//this.addressData.type = '-'
|
|
123
|
+
const saveAddress = async () => {
|
|
115
124
|
try {
|
|
116
|
-
await
|
|
125
|
+
await setCoordinates()
|
|
117
126
|
} catch (e) {
|
|
118
127
|
console.log('Geocoder problem', e)
|
|
119
128
|
}
|
|
120
129
|
|
|
121
130
|
try {
|
|
122
|
-
let response = await AddressRepository.edit(
|
|
131
|
+
let response = await AddressRepository.edit(addressData.value)
|
|
123
132
|
if (response.status == 201 || response.status == 200) {
|
|
124
|
-
|
|
125
|
-
message:
|
|
133
|
+
$buefy.toast.open({
|
|
134
|
+
message: $t('address.savedNotification'),
|
|
126
135
|
type: 'is-success'
|
|
127
136
|
})
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
137
|
+
emit('saved', response.data.data)
|
|
138
|
+
showEditAddressDialog.value = false
|
|
139
|
+
addressData.value = { ...addressSchema }
|
|
140
|
+
getAddresses()
|
|
132
141
|
}
|
|
133
142
|
} catch (error) {
|
|
134
143
|
if (error.errors) {
|
|
135
|
-
|
|
144
|
+
validationErrors.value = error.errors
|
|
136
145
|
}
|
|
137
146
|
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
},
|
|
147
|
+
}
|
|
141
148
|
|
|
142
|
-
|
|
143
|
-
|
|
149
|
+
// Lifecycle
|
|
150
|
+
onMounted(() => {
|
|
151
|
+
getAddresses()
|
|
144
152
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
eventBus.on('EditAddress:saved', () => {
|
|
154
|
+
getAddresses()
|
|
155
|
+
})
|
|
148
156
|
})
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
addressRepository,
|
|
160
|
+
addresses,
|
|
161
|
+
addressData,
|
|
162
|
+
validationErrors,
|
|
163
|
+
showEditAddressDialog,
|
|
164
|
+
getAddresses,
|
|
165
|
+
addAddress,
|
|
166
|
+
editAddress,
|
|
167
|
+
saveAddress
|
|
168
|
+
}
|
|
149
169
|
}
|
|
150
170
|
}
|
|
151
171
|
</script>
|