Fix menu
gitea/hedera-web/pipeline/pr-beta This commit looks good
Details
gitea/hedera-web/pipeline/pr-beta This commit looks good
Details
This commit is contained in:
parent
52fe0f9f55
commit
ba0500725c
|
@ -32,8 +32,7 @@ export const useAppStore = defineStore('hedera', {
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
async getMenuLinks() {
|
async getMenuLinks() {
|
||||||
const { data: sections } = await api.get('MyMenus');
|
const { data: sections } = await api.get('MyMenus/myMenu');
|
||||||
|
|
||||||
if (!sections) return;
|
if (!sections) return;
|
||||||
|
|
||||||
const sectionMap = new Map();
|
const sectionMap = new Map();
|
||||||
|
@ -92,32 +91,39 @@ export const useAppStore = defineStore('hedera', {
|
||||||
|
|
||||||
async checkRedirect(checkoutContinue) {
|
async checkRedirect(checkoutContinue) {
|
||||||
const orderId = this.basketOrderId;
|
const orderId = this.basketOrderId;
|
||||||
const myOrder_checkConfig = await api.post('applications/myOrder_checkConfig/execute-proc', {
|
const myOrder_checkConfig = await api.post(
|
||||||
schema: 'hedera',
|
'applications/myOrder_checkConfig/execute-proc',
|
||||||
params: [orderId],
|
{
|
||||||
}, {
|
schema: 'hedera',
|
||||||
validateStatus: () => true,
|
params: [orderId]
|
||||||
});
|
},
|
||||||
|
{
|
||||||
|
validateStatus: () => true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
if (myOrder_checkConfig.status >= 200 && myOrder_checkConfig.status < 300) {
|
if (
|
||||||
return true;
|
myOrder_checkConfig.status >= 200 &&
|
||||||
|
myOrder_checkConfig.status < 300
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (myOrder_checkConfig.data.error?.message) {
|
switch (myOrder_checkConfig.data.error?.message) {
|
||||||
case 'orderNotOwnedByUser':
|
case 'orderNotOwnedByUser':
|
||||||
notify(t(`errors.orderNotOwnedByUser`), 'negative');
|
notify(t(`errors.orderNotOwnedByUser`), 'negative');
|
||||||
case 'orderConfirmed':
|
case 'orderConfirmed':
|
||||||
case 'orderNotOwnedByUser':
|
case 'orderNotOwnedByUser':
|
||||||
this.unloadOrder();
|
this.unloadOrder();
|
||||||
await this.redirect();
|
await this.redirect();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.router.push({
|
this.router.push({
|
||||||
name: 'checkout',
|
name: 'checkout',
|
||||||
params: { id: this.basketOrderId },
|
params: { id: this.basketOrderId },
|
||||||
query: { continue: checkoutContinue }
|
query: { continue: checkoutContinue }
|
||||||
});
|
});
|
||||||
notify(myOrder_checkConfig.data.error.message, 'negative');
|
notify(myOrder_checkConfig.data.error.message, 'negative');
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue