Fix brand color modal cancel button and simplify API query

- Changed hideModal() to closeModal() in color picker
- Simplified queryExecute parameter handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-01-18 12:26:36 -08:00
parent a089b89e17
commit 0038c481ab
2 changed files with 3 additions and 3 deletions

View file

@ -52,7 +52,7 @@ queryExecute("
SET BusinessBrandColor = :color
WHERE BusinessID = :bizId
", {
color: { value: len(brandColor) ? brandColor : "", null: !len(brandColor), cfsqltype: "cf_sql_varchar" },
color: { value: brandColor, cfsqltype: "cf_sql_varchar" },
bizId: { value: bizId, cfsqltype: "cf_sql_integer" }
}, { datasource: "payfrit" });

View file

@ -3022,7 +3022,7 @@
<button type="button" class="color-preset" data-color="#355E3B" style="width: 32px; height: 32px; border-radius: 4px; border: 2px solid transparent; cursor: pointer; background: #355E3B;" title="Hunter Green"></button>
</div>
<div style="display: flex; gap: 8px; justify-content: flex-end;">
<button type="button" class="btn btn-secondary" onclick="MenuBuilder.hideModal()">Cancel</button>
<button type="button" class="btn btn-secondary" onclick="MenuBuilder.closeModal()">Cancel</button>
<button type="button" class="btn btn-primary" onclick="MenuBuilder.saveBrandColor()">Save Color</button>
</div>
`;
@ -3080,7 +3080,7 @@
if (data.OK) {
this.brandColor = color;
document.getElementById('brandColorSwatch').style.background = color;
this.hideModal();
this.closeModal();
this.toast('Brand color saved!', 'success');
} else {
this.toast(data.MESSAGE || 'Failed to save color', 'error');