All lookup/reference tables use prefixed column names (tt_StateID, tt_StateAbbreviation, tt_DayID, tt_DayAbbrev, tt_OrderTypeID, tt_OrderTypeName, ServicePointID, ServicePointName, UserID, UserFirstName, UserLastName, AddressID, AddressLine1, etc). Updated all affected queries to use correct column names with aliases to maintain API compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
35 lines
865 B
Text
35 lines
865 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 tt_StateID as StateID, tt_StateAbbreviation as StateAbbreviation, tt_StateName as StateName
|
|
FROM tt_States
|
|
ORDER BY tt_StateName
|
|
", {}, { 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>
|