diff --git a/api/businesses/get.cfm b/api/businesses/get.cfm index a7380ca..47a0889 100644 --- a/api/businesses/get.cfm +++ b/api/businesses/get.cfm @@ -141,7 +141,7 @@ try { "IsHiring": q.BusinessIsHiring == 1, "TaxRate": taxRate, "TaxRatePercent": taxRate * 100, - "BrandColor": len(q.BusinessBrandColor) ? q.BusinessBrandColor : "" + "BrandColor": len(q.BusinessBrandColor) ? (left(q.BusinessBrandColor, 1) == chr(35) ? q.BusinessBrandColor : chr(35) & q.BusinessBrandColor) : "" }; // Add header image URL if extension exists diff --git a/api/businesses/saveBrandColor.cfm b/api/businesses/saveBrandColor.cfm index 9164c43..e110e8e 100644 --- a/api/businesses/saveBrandColor.cfm +++ b/api/businesses/saveBrandColor.cfm @@ -47,8 +47,8 @@ if (len(brandColor) GT 0) { if (len(brandColor) != 6 || !reFind("^[0-9A-Fa-f]{6}$", brandColor)) { apiAbort({ "OK": false, "ERROR": "invalid_color", "MESSAGE": "Color must be a valid 6-digit hex color (e.g. 1B4D3E or ##1B4D3E)" }); } - // Store with # prefix, uppercase - brandColor = chr(35) & uCase(brandColor); + // Store uppercase, no # prefix + brandColor = uCase(brandColor); } // Update the database diff --git a/api/menu/getForBuilder.cfm b/api/menu/getForBuilder.cfm index 2c93919..0b29468 100644 --- a/api/menu/getForBuilder.cfm +++ b/api/menu/getForBuilder.cfm @@ -411,7 +411,7 @@ try { SELECT BusinessBrandColor FROM Businesses WHERE BusinessID = :bizId ", { bizId: businessID }, { datasource: "payfrit" }); if (qBrand.recordCount > 0 && len(trim(qBrand.BusinessBrandColor))) { - brandColor = qBrand.BusinessBrandColor; + brandColor = left(qBrand.BusinessBrandColor, 1) == chr(35) ? qBrand.BusinessBrandColor : chr(35) & qBrand.BusinessBrandColor; } } catch (any e) { // Column may not exist yet, ignore diff --git a/api/menu/items.cfm b/api/menu/items.cfm index 7ef995f..5b484ab 100644 --- a/api/menu/items.cfm +++ b/api/menu/items.cfm @@ -497,7 +497,7 @@ { datasource = "payfrit" } )> - +