API Improvements: - api/businesses/get.cfm: Fetch address from Addresses table, hours from Hours table - api/tasks/getDetails.cfm: Add CustomerPhone field from UserContactNumber - api/orders/getDetail.cfm: New endpoint for order details with line items - api/Application.cfm: Add new admin endpoints to public allowlist Admin Tools: - api/admin/beaconStatus.cfm: View all beacon-to-business mappings - api/admin/updateBeaconMapping.cfm: Change beacon business assignment - api/admin/setupBigDeansInfo.cfm: Set Big Dean's address and hours - api/admin/listTables.cfm: List all database tables - api/admin/describeTable.cfm: Get table structure and sample data - api/admin/randomizePrices.cfm: Randomize item prices for testing - Various Big Dean's debug/update scripts Portal Enhancements: - Enhanced CSS styling for portal pages - Improved portal.js functionality 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
54 lines
1.4 KiB
Text
54 lines
1.4 KiB
Text
<cfsetting showdebugoutput="false">
|
|
<cfsetting enablecfoutputonly="true">
|
|
<cfcontent type="application/json; charset=utf-8" reset="true">
|
|
|
|
<cfscript>
|
|
try {
|
|
requestBody = toString(getHttpRequestData().content);
|
|
requestData = {};
|
|
if (len(requestBody)) {
|
|
requestData = deserializeJSON(requestBody);
|
|
}
|
|
|
|
tableName = requestData.table ?: "";
|
|
if (len(tableName) == 0) {
|
|
writeOutput(serializeJSON({ "OK": false, "ERROR": "table parameter required" }));
|
|
abort;
|
|
}
|
|
|
|
// Get table structure
|
|
cols = queryExecute("DESCRIBE #tableName#", {}, { datasource: "payfrit" });
|
|
|
|
columns = [];
|
|
for (c in cols) {
|
|
arrayAppend(columns, {
|
|
"Field": c.Field,
|
|
"Type": c.Type,
|
|
"Null": c.Null,
|
|
"Key": c.Key,
|
|
"Default": isNull(c.Default) ? "NULL" : c.Default
|
|
});
|
|
}
|
|
|
|
// Get sample data
|
|
sampleData = queryExecute("SELECT * FROM #tableName# LIMIT 5", {}, { datasource: "payfrit" });
|
|
|
|
samples = [];
|
|
for (row in sampleData) {
|
|
arrayAppend(samples, row);
|
|
}
|
|
|
|
writeOutput(serializeJSON({
|
|
"OK": true,
|
|
"TABLE": tableName,
|
|
"COLUMNS": columns,
|
|
"SAMPLE_DATA": sampleData,
|
|
"ROW_COUNT": sampleData.recordCount
|
|
}));
|
|
} catch (any e) {
|
|
writeOutput(serializeJSON({
|
|
"OK": false,
|
|
"ERROR": e.message
|
|
}));
|
|
}
|
|
</cfscript>
|