Skip to content

Commit

Permalink
Improved: message to be shown in missing configuration and check for …
Browse files Browse the repository at this point in the history
…empty settingValue (hotwax#293)
  • Loading branch information
amansinghbais committed Aug 7, 2024
1 parent be3c61d commit 77f3392
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
16 changes: 8 additions & 8 deletions src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ const runNow = async (): Promise<any> => {

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)) {
Expand All @@ -260,7 +260,7 @@ const runNow = async (): Promise<any> => {
data: payload
});

if(!hasError(resp)) {
if(!hasError(resp) && resp.data.docs[0].settingValue) {
routingGroupId = resp.data.docs[0].settingValue
} else {
throw resp.data;
Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ const actions: ActionTree<UserState, RootState> = {
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
Expand Down

0 comments on commit 77f3392

Please sign in to comment.