Remove debug alerts from portal.js

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-02-01 08:15:22 -08:00
parent 6ba3f3dffd
commit 0258531c3d

View file

@ -715,7 +715,6 @@ const Portal = {
// Load business info for settings // Load business info for settings
async loadBusinessInfo() { async loadBusinessInfo() {
alert('DEBUG 1: loadBusinessInfo called, bizId=' + this.config.businessId);
try { try {
const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.cfm`, { const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.cfm`, {
method: 'POST', method: 'POST',
@ -723,7 +722,6 @@ const Portal = {
body: JSON.stringify({ BusinessID: this.config.businessId }) body: JSON.stringify({ BusinessID: this.config.businessId })
}); });
const data = await response.json(); const data = await response.json();
alert('DEBUG 2: API response OK=' + data.OK + ', hasBiz=' + !!data.BUSINESS + ', keys=' + (data.BUSINESS ? Object.keys(data.BUSINESS).join(',') : 'none'));
if (data.OK && data.BUSINESS) { if (data.OK && data.BUSINESS) {
// Normalize all keys to uppercase for consistent access // Normalize all keys to uppercase for consistent access
@ -733,8 +731,6 @@ const Portal = {
Object.keys(raw).forEach(k => { biz[k.toUpperCase()] = raw[k]; }); Object.keys(raw).forEach(k => { biz[k.toUpperCase()] = raw[k]; });
this.currentBusiness = biz; this.currentBusiness = biz;
alert('DEBUG 3: BRANDCOLOR=[' + biz.BRANDCOLOR + '] HEADERIMAGEURL=[' + biz.HEADERIMAGEURL + ']');
// Populate form fields // Populate form fields
document.getElementById('settingBusinessName').value = biz.NAME || biz.BUSINESSNAME || ''; document.getElementById('settingBusinessName').value = biz.NAME || biz.BUSINESSNAME || '';
document.getElementById('settingPhone').value = biz.PHONE || biz.BUSINESSPHONE || ''; document.getElementById('settingPhone').value = biz.PHONE || biz.BUSINESSPHONE || '';
@ -758,12 +754,8 @@ const Portal = {
const headerUrl = biz.HEADERIMAGEURL || ''; const headerUrl = biz.HEADERIMAGEURL || '';
if (headerPreview && headerUrl) { if (headerPreview && headerUrl) {
headerPreview.onload = function() { headerPreview.onload = function() {
alert('DEBUG 4: img loaded OK');
if (headerWrapper) headerWrapper.style.display = 'block'; if (headerWrapper) headerWrapper.style.display = 'block';
}; };
headerPreview.onerror = function() {
alert('DEBUG 4: img FAILED to load: ' + headerPreview.src);
};
headerPreview.src = `${headerUrl}?t=${Date.now()}`; headerPreview.src = `${headerUrl}?t=${Date.now()}`;
} }
@ -771,7 +763,6 @@ const Portal = {
this.renderHoursEditor(biz.HOURSDETAIL || biz.BUSINESSHOURSDETAIL || []); this.renderHoursEditor(biz.HOURSDETAIL || biz.BUSINESSHOURSDETAIL || []);
} }
} catch (err) { } catch (err) {
alert('DEBUG ERR: ' + err.message);
console.error('[Portal] Error loading business info:', err); console.error('[Portal] Error loading business info:', err);
} }
}, },