Skip to content

Commit

Permalink
Improved: code for handling edge cases (hotwax#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Aug 6, 2024
1 parent 21f083e commit a21dca7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const moquiLogin = async (omsRedirectionUrl: string, token: string): Promise <an
throw "Sorry, login failed. Please try again";
}
} catch(err) {
return Promise.resolve("Sorry, login failed. Please try again");
return Promise.resolve("");
}
return Promise.resolve(api_key)
}
Expand Down
2 changes: 2 additions & 0 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ const actions: ActionTree<UserState, RootState> = {
const api_key = await UserService.moquiLogin(omsRedirectionUrl, token)
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."))
}
} else {
showToast(translate("Some functionality of this app might not work properly, Since moqui is not setup for this account."))
Expand Down
2 changes: 1 addition & 1 deletion src/views/product-details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export default defineComponent({
'Content-Type': 'multipart/form-data;'
},
data: formData
}).then(async () => {
}).then(() => {
this.store.dispatch("order/removeItems", { items: selectedItems });
UserService.runNow();
}).finally(() => emitter.emit("dismissLoader"))
Expand Down

0 comments on commit a21dca7

Please sign in to comment.