orderiom-api-package 0.4.40 → 0.4.42
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/package.json +1 -1
- package/src/common.js +1 -1
- package/src/modules/order.js +16 -5
package/package.json
CHANGED
package/src/common.js
CHANGED
|
@@ -16,7 +16,7 @@ export function commonErrorCallback(unknownErrorMessage = 'Something went wrong'
|
|
|
16
16
|
if (status === 422) {
|
|
17
17
|
return {
|
|
18
18
|
type: 'error',
|
|
19
|
-
msg: Object.values(error.response.data.error.validation)[0],
|
|
19
|
+
msg: Object.values(error.response.data.error.validation)[0][0],
|
|
20
20
|
}
|
|
21
21
|
} else if ([401, 403, 404, 400].includes(status)) {
|
|
22
22
|
return {
|
package/src/modules/order.js
CHANGED
|
@@ -652,7 +652,7 @@ const actions = {
|
|
|
652
652
|
|
|
653
653
|
return {
|
|
654
654
|
type: 'error',
|
|
655
|
-
msg: Object.values(validation)[0],
|
|
655
|
+
msg: Object.values(validation)[0][0],
|
|
656
656
|
name,
|
|
657
657
|
validTime
|
|
658
658
|
}
|
|
@@ -885,7 +885,7 @@ const actions = {
|
|
|
885
885
|
|
|
886
886
|
return {
|
|
887
887
|
type: 'error',
|
|
888
|
-
msg: Object.values(validation)[0],
|
|
888
|
+
msg: Object.values(validation)[0][0],
|
|
889
889
|
name,
|
|
890
890
|
validTime
|
|
891
891
|
}
|
|
@@ -913,16 +913,27 @@ const actions = {
|
|
|
913
913
|
},
|
|
914
914
|
addReview({commit}, data) {
|
|
915
915
|
commit('setSubmittingReview', true);
|
|
916
|
-
return $http.post("testimonials/create", data).then(
|
|
916
|
+
return $http.post("api/testimonials/create", data).then(res => ({
|
|
917
917
|
type: 'success',
|
|
918
918
|
msg: '',
|
|
919
|
+
data: res.data
|
|
919
920
|
})).catch(
|
|
920
921
|
commonErrorCallback()
|
|
921
922
|
).finally(() => {
|
|
922
|
-
commit('setSubmittingReview',
|
|
923
|
+
commit('setSubmittingReview', false);
|
|
923
924
|
});
|
|
924
925
|
},
|
|
925
|
-
|
|
926
|
+
getTestimonials({commit}, id) {
|
|
927
|
+
const idToShow = id ? '/show?testimonialId' + id : ''
|
|
928
|
+
return $http.get(`api/testimonials${idToShow}`).then(res => ({
|
|
929
|
+
type: 'success',
|
|
930
|
+
msg: '',
|
|
931
|
+
data: res.data
|
|
932
|
+
})).catch(
|
|
933
|
+
commonErrorCallback()
|
|
934
|
+
)
|
|
935
|
+
},
|
|
936
|
+
addVoucher({ rootState, dispatch }, data) {
|
|
926
937
|
let basketId = undefined;
|
|
927
938
|
try {
|
|
928
939
|
basketId = calculateBasketIdParameter(
|