monkey-front-core 0.0.149 → 0.0.150
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/core/services/error/monkeyecx-http-error-handling.service.mjs +11 -3
- package/fesm2015/monkey-front-core.mjs +10 -2
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +10 -2
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/monkey-front-core-0.0.150.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.149.tgz +0 -0
|
@@ -3663,17 +3663,25 @@ class MonkeyEcxHttpErrorHandlingService extends MonkeyEcxCommonsService {
|
|
|
3663
3663
|
}
|
|
3664
3664
|
}
|
|
3665
3665
|
handleError(error, mkc) {
|
|
3666
|
-
const { router } = this;
|
|
3666
|
+
const { router, tokenStorage } = this;
|
|
3667
3667
|
const { status } = error;
|
|
3668
|
+
const { companyType } = tokenStorage?.getToken() || { companyType: '' };
|
|
3668
3669
|
const routes = {
|
|
3669
3670
|
403: 'forbidden',
|
|
3670
3671
|
500: 'service-problems',
|
|
3671
3672
|
503: 'service-problems'
|
|
3672
3673
|
};
|
|
3674
|
+
let route = '/app';
|
|
3675
|
+
if (companyType) {
|
|
3676
|
+
route = `${route}/${companyType}/pages`;
|
|
3677
|
+
}
|
|
3678
|
+
else {
|
|
3679
|
+
route = `${route}/pages`;
|
|
3680
|
+
}
|
|
3673
3681
|
const found = routes[status];
|
|
3674
3682
|
let timeout = 0;
|
|
3675
3683
|
if (found && !this.isHttpCodeIgnoreRedirect(mkc, error?.status)) {
|
|
3676
|
-
|
|
3684
|
+
route = `${route}/${found}`.toLowerCase();
|
|
3677
3685
|
timeout = 800;
|
|
3678
3686
|
router.navigate([route]);
|
|
3679
3687
|
}
|