From 77f339267b44afbd32d064d2a672e60072cda775 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 7 Aug 2024 12:27:46 +0530 Subject: [PATCH] Improved: message to be shown in missing configuration and check for empty settingValue (#293) --- src/i18n/locales/en.json | 2 +- src/services/UserService.ts | 16 ++++++++-------- src/store/modules/user/actions.ts | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 80cbe639..2a16ae20 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -207,7 +207,7 @@ "Size": "Size", "Sizes": "Sizes", "sku selected": "sku selected", - "Some functionality of this app might not work properly, Since moqui is not setup for this account.": "Some functionality of this app might not work properly, Since moqui is not setup for this account.", + "Some of the configuration of the app is missing.": "Some of the configuration of the app is missing.", "Some listing data not available": "Some listing data not available", "Something went wrong": "Something went wrong", "Something went wrong while login. Please contact administrator.": "Something went wrong while login. Please contact administrator.", diff --git a/src/services/UserService.ts b/src/services/UserService.ts index cfe4d42a..d5d65637 100644 --- a/src/services/UserService.ts +++ b/src/services/UserService.ts @@ -231,13 +231,13 @@ const runNow = async (): Promise => { try { resp = await client({ - url: "checkOmsConnection", - method: "GET", - baseURL, - headers: { - "api_key": omsRedirectionInfo.token, - "Content-Type": "application/json" - } + url: "checkOmsConnection", + method: "GET", + baseURL, + headers: { + "api_key": omsRedirectionInfo.token, + "Content-Type": "application/json" + } }); if(hasError(resp)) { @@ -260,7 +260,7 @@ const runNow = async (): Promise => { data: payload }); - if(!hasError(resp)) { + if(!hasError(resp) && resp.data.docs[0].settingValue) { routingGroupId = resp.data.docs[0].settingValue } else { throw resp.data; diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 793c0baf..73e42d77 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -71,10 +71,10 @@ const actions: ActionTree = { if(api_key) { dispatch("setOmsRedirectionInfo", { url: omsRedirectionUrl, token: api_key }) } else { - showToast(translate("Some functionality of this app might not work properly, Since moqui is not setup for this account.")) + console.error("Some of the configuration of the app is missing."); } } else { - showToast(translate("Some functionality of this app might not work properly, Since moqui is not setup for this account.")) + console.error("Some of the configuration of the app is missing.") } // TODO user single mutation