Set default landing page for counter role to Inventory
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled

This commit is contained in:
2026-07-18 17:44:00 +00:00
parent a4f90cd4a3
commit c374cccd77
2 changed files with 9 additions and 2 deletions

View File

@@ -261,7 +261,14 @@
allowed.push(permMap[p]); allowed.push(permMap[p]);
} }
} }
fallback = allowed.length ? allowed[0] : '/pos/login'; // Role-specific default landing pages.
if (userRole === 'counter' && allowed.indexOf('/pos/inventory') !== -1) {
fallback = '/pos/inventory';
} else if (userRole === 'cashier' && allowed.indexOf('/pos/sale') !== -1) {
fallback = '/pos/sale';
} else {
fallback = allowed.length ? allowed[0] : '/pos/login';
}
} else { } else {
fallback = '/pos/dashboard'; fallback = '/pos/dashboard';
} }

View File

@@ -6,7 +6,7 @@
// The fetch handler normalizes static asset URLs (strips ?v= query strings) // The fetch handler normalizes static asset URLs (strips ?v= query strings)
// so templates can use cache-busting query params freely. // so templates can use cache-busting query params freely.
const VERSION = 52; const VERSION = 53;
const CACHE_NAME = 'nexus-pos-v' + VERSION; const CACHE_NAME = 'nexus-pos-v' + VERSION;
const APP_SHELL = [ const APP_SHELL = [