Updated 70 files to match the payfrit_dev schema where columns like BusinessName→Name, UserFirstName→FirstName, AddressCity→City, etc. PKs renamed to ID, FKs keep referenced table name (e.g. BusinessID). SQL aliases preserve original JSON response keys for API compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
35 lines
833 B
Text
35 lines
833 B
Text
<cfsetting showdebugoutput="false">
|
|
<cfsetting enablecfoutputonly="true">
|
|
<cfcontent type="application/json; charset=utf-8">
|
|
|
|
<!--- List US states for address forms --->
|
|
<cfscript>
|
|
try {
|
|
qStates = queryExecute("
|
|
SELECT ID as StateID, Abbreviation as StateAbbreviation, Name as StateName
|
|
FROM tt_States
|
|
ORDER BY Name
|
|
", {}, { datasource: "payfrit" });
|
|
|
|
states = [];
|
|
for (row in qStates) {
|
|
arrayAppend(states, {
|
|
"StateID": row.StateID,
|
|
"Abbr": row.StateAbbreviation,
|
|
"Name": row.StateName
|
|
});
|
|
}
|
|
|
|
writeOutput(serializeJSON({
|
|
"OK": true,
|
|
"STATES": states
|
|
}));
|
|
|
|
} catch (any e) {
|
|
writeOutput(serializeJSON({
|
|
"OK": false,
|
|
"ERROR": "server_error",
|
|
"MESSAGE": e.message
|
|
}));
|
|
}
|
|
</cfscript>
|