Fix portal header image by using uppercase Lucee JSON keys
Lucee's serializeJSON converts all struct keys to UPPERCASE. Updated loadBusinessInfo to check for uppercase key variants. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
74b09beedf
commit
4c40e9a2e9
1 changed files with 16 additions and 14 deletions
|
|
@ -706,30 +706,32 @@ const Portal = {
|
||||||
const biz = data.BUSINESS;
|
const biz = data.BUSINESS;
|
||||||
this.currentBusiness = biz;
|
this.currentBusiness = biz;
|
||||||
|
|
||||||
// Populate form fields
|
// Populate form fields (Lucee serializes all keys as uppercase)
|
||||||
document.getElementById('settingBusinessName').value = biz.BusinessName || '';
|
document.getElementById('settingBusinessName').value = biz.BUSINESSNAME || biz.BusinessName || '';
|
||||||
document.getElementById('settingPhone').value = biz.BusinessPhone || '';
|
document.getElementById('settingPhone').value = biz.BUSINESSPHONE || biz.BusinessPhone || '';
|
||||||
document.getElementById('settingTaxRate').value = biz.TaxRatePercent || '';
|
document.getElementById('settingTaxRate').value = biz.TAXRATEPERCENT || biz.TaxRatePercent || '';
|
||||||
document.getElementById('settingAddressLine1').value = biz.AddressLine1 || '';
|
document.getElementById('settingAddressLine1').value = biz.ADDRESSLINE1 || biz.AddressLine1 || '';
|
||||||
document.getElementById('settingCity').value = biz.AddressCity || '';
|
document.getElementById('settingCity').value = biz.ADDRESSCITY || biz.AddressCity || '';
|
||||||
document.getElementById('settingState').value = biz.AddressState || '';
|
document.getElementById('settingState').value = biz.ADDRESSSTATE || biz.AddressState || '';
|
||||||
document.getElementById('settingZip').value = biz.AddressZip || '';
|
document.getElementById('settingZip').value = biz.ADDRESSZIP || biz.AddressZip || '';
|
||||||
|
|
||||||
// Load brand color if set
|
// Load brand color if set
|
||||||
if (biz.BrandColor) {
|
const brandColor = biz.BRANDCOLOR || biz.BrandColor;
|
||||||
this.brandColor = biz.BrandColor;
|
if (brandColor) {
|
||||||
|
this.brandColor = brandColor;
|
||||||
const swatch = document.getElementById('brandColorSwatch');
|
const swatch = document.getElementById('brandColorSwatch');
|
||||||
if (swatch) swatch.style.background = biz.BrandColor;
|
if (swatch) swatch.style.background = brandColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load header preview
|
// Load header preview
|
||||||
const headerPreview = document.getElementById('headerPreview');
|
const headerPreview = document.getElementById('headerPreview');
|
||||||
if (headerPreview && biz.HeaderImageURL) {
|
const headerUrl = biz.HEADERIMAGEURL || biz.HeaderImageURL;
|
||||||
headerPreview.style.backgroundImage = `url(${biz.HeaderImageURL}?t=${Date.now()})`;
|
if (headerPreview && headerUrl) {
|
||||||
|
headerPreview.style.backgroundImage = `url(${headerUrl}?t=${Date.now()})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render hours editor
|
// Render hours editor
|
||||||
this.renderHoursEditor(biz.BusinessHoursDetail || []);
|
this.renderHoursEditor(biz.BUSINESSHOURSDETAIL || biz.BusinessHoursDetail || []);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('[Portal] Error loading business info:', err);
|
console.error('[Portal] Error loading business info:', err);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue