diff --git a/portal/login.html b/portal/login.html index df52202..dc4bbc1 100644 --- a/portal/login.html +++ b/portal/login.html @@ -264,8 +264,9 @@ }, async verifyAndRedirect(token, businessId) { - // For now, just redirect - could add token verification - window.location.href = BASE_PATH + `/portal/index.html?bid=${businessId}`; + // Save business ID to localStorage and redirect + localStorage.setItem('payfrit_portal_business', businessId); + window.location.href = BASE_PATH + '/portal/index.html'; }, async login() { @@ -413,7 +414,7 @@ selectBusinessById(businessId) { localStorage.setItem('payfrit_portal_business', businessId); - window.location.href = BASE_PATH + `/portal/index.html?bid=${businessId}`; + window.location.href = BASE_PATH + '/portal/index.html'; }, startNewRestaurant() { diff --git a/portal/menu-builder.html b/portal/menu-builder.html index b1dc681..38ab752 100644 --- a/portal/menu-builder.html +++ b/portal/menu-builder.html @@ -1048,9 +1048,8 @@ return; } - // Get business ID from URL or saved - const urlParams = new URLSearchParams(window.location.search); - this.config.businessId = parseInt(urlParams.get('bid')) || parseInt(savedBusiness); + // Get business ID from localStorage + this.config.businessId = parseInt(savedBusiness) || null; this.config.token = token; // Load business info diff --git a/portal/portal.js b/portal/portal.js index 787a73b..08693d4 100644 --- a/portal/portal.js +++ b/portal/portal.js @@ -65,9 +65,8 @@ const Portal = { return; } - // Use saved business ID, but allow URL override - const urlParams = new URLSearchParams(window.location.search); - this.config.businessId = parseInt(urlParams.get('bid')) || parseInt(savedBusiness); + // Use saved business ID from localStorage + this.config.businessId = parseInt(savedBusiness) || null; this.config.userId = parseInt(userId) || 1; this.config.token = token; @@ -409,7 +408,7 @@ const Portal = {
Drag-and-drop interface to build menus. Clone items, add modifiers, create photo tasks.
- + Open Builder @@ -422,7 +421,7 @@ const Portal = {Drag items to stations (Grill, Fry, Drinks, etc.) for KDS routing.
- + Assign Stations diff --git a/portal/setup-wizard.html b/portal/setup-wizard.html index a8888b9..eec32e3 100644 --- a/portal/setup-wizard.html +++ b/portal/setup-wizard.html @@ -974,11 +974,8 @@ }); function initializeConfig() { - // Get business ID from URL only - don't use localStorage for wizard - // The wizard is for creating NEW businesses, so we shouldn't default to an existing one - // Only use bid from URL if explicitly editing an existing business - const urlParams = new URLSearchParams(window.location.search); - config.businessId = urlParams.get('bid') || null; + // Wizard is for creating NEW businesses - businessId starts as null + config.businessId = null; // Determine API base URL const basePath = window.location.pathname.includes('/biz.payfrit.com/') @@ -2031,7 +2028,7 @@ // Redirect to visual menu builder after a moment setTimeout(() => { - window.location.href = `index.html?bid=${finalBusinessId}#menu`; + window.location.href = 'index.html#menu'; }, 1500); } catch (error) { diff --git a/portal/station-assignment.html b/portal/station-assignment.html index 5764b28..be3c1c9 100644 --- a/portal/station-assignment.html +++ b/portal/station-assignment.html @@ -441,8 +441,7 @@ return; } - const urlParams = new URLSearchParams(window.location.search); - this.config.businessId = parseInt(urlParams.get('bid')) || parseInt(savedBusiness); + this.config.businessId = parseInt(savedBusiness) || null; this.config.token = token; await this.loadBusinessInfo();