- Add uploadHeader.cfm API for 1200px header images - Add saveBrandColor.cfm API for hex color storage - Add Branding section to menu builder sidebar - Fix header upload path and permissions - Various beacon and service point API improvements Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
49 lines
1.8 KiB
Text
49 lines
1.8 KiB
Text
<cfsetting showdebugoutput="false">
|
|
<cfsetting enablecfoutputonly="true">
|
|
<cfcontent type="application/json; charset=utf-8" reset="true">
|
|
|
|
<cfscript>
|
|
response = { "OK": false, "steps": [] };
|
|
|
|
try {
|
|
// Business IDs to delete (Lo/Cal Coffee and SANTA MONICA entries)
|
|
businessIDs = [38, 39, 40, 41, 42];
|
|
|
|
for (bizID in businessIDs) {
|
|
// Delete ItemTemplateLinks for items belonging to this business
|
|
queryExecute("
|
|
DELETE itl FROM ItemTemplateLinks itl
|
|
INNER JOIN Items i ON i.ItemID = itl.ItemID
|
|
WHERE i.ItemBusinessID = :bizID
|
|
", { bizID: bizID }, { datasource: "payfrit" });
|
|
|
|
// Delete Items
|
|
queryExecute("DELETE FROM Items WHERE ItemBusinessID = :bizID", { bizID: bizID }, { datasource: "payfrit" });
|
|
|
|
// Delete Categories
|
|
queryExecute("DELETE FROM Categories WHERE CategoryBusinessID = :bizID", { bizID: bizID }, { datasource: "payfrit" });
|
|
|
|
// Delete Hours
|
|
queryExecute("DELETE FROM Hours WHERE HoursBusinessID = :bizID", { bizID: bizID }, { datasource: "payfrit" });
|
|
|
|
// Delete Addresses linked to this business
|
|
queryExecute("DELETE FROM Addresses WHERE AddressBusinessID = :bizID", { bizID: bizID }, { datasource: "payfrit" });
|
|
|
|
// Delete the Business itself
|
|
queryExecute("DELETE FROM Businesses WHERE BusinessID = :bizID", { bizID: bizID }, { datasource: "payfrit" });
|
|
|
|
response.steps.append("Deleted business " & bizID & " and all related data");
|
|
}
|
|
|
|
response.OK = true;
|
|
response.message = "Cleared all Lo/Cal Coffee and SANTA MONICA businesses";
|
|
|
|
} catch (any e) {
|
|
response.error = e.message;
|
|
if (len(e.detail)) {
|
|
response.detail = e.detail;
|
|
}
|
|
}
|
|
|
|
writeOutput(serializeJSON(response));
|
|
</cfscript>
|