this.$store.dispatch(GET_ORDER, order).then(() => {
let data = {};
data.id = order;
data.order = {
status,
comment,
totalPrice,
paymentMethod
};
return this.$store.dispatch(PATCH_ORDER, data);
}).catch(() => {
return this.$store.dispatch(POST_ORDER, {
id,
status,
comment,
totalPrice,
paymentMethod
});
}).then(() => {
if (this.responseServer) {
this.$refs.modalSend.hide();
this.status = 1;
}
});