Skip to content

Commit

Permalink
Fixed the citizen routing issue in sandbox env (#1383)
Browse files Browse the repository at this point in the history
Update App.js

citizen related changes
  • Loading branch information
aaradhya-egov committed Sep 11, 2024
1 parent 374c3fe commit 815f9fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions micro-ui/web/sandbox/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ function App() {
const isMultiRootTenant = window?.globalConfigs?.getConfig("MULTI_ROOT_TENANT") || false;

if (isMultiRootTenant) {
const pathname = window.location.pathname;
const pathname = window.location.pathname;
const context = window?.globalConfigs?.getConfig("CONTEXT_PATH");
const start = pathname.indexOf(context) + context.length + 1;
const end = pathname.indexOf("employee");
const employeeIndex = pathname.indexOf("employee");
const citizenIndex = pathname.indexOf("citizen");
const end = (employeeIndex !== -1) ? employeeIndex : (citizenIndex !== -1) ? citizenIndex : -1;
const tenant = end > start ? pathname.substring(start, end).replace(/\/$/, "") : "";
window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH") + `${tenant ? `/${tenant}` : ""}` || "digit-ui";
window.globalPath = window?.globalConfigs?.getConfig("CONTEXT_PATH") || "digit-ui";
Expand Down

0 comments on commit 815f9fa

Please sign in to comment.