- Add /addresses/types.cfm - returns address types list - Update /addresses/list.cfm - include TypeID in response - Update /addresses/add.cfm - accept TypeID instead of hardcoded '2' - Fix loginOTP.cfm and sendOTP.cfm to skip Twilio SMS on dev server Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
40 lines
930 B
Text
40 lines
930 B
Text
<cfsetting showdebugoutput="false">
|
|
<cfsetting enablecfoutputonly="true">
|
|
<cfcontent type="application/json; charset=utf-8" reset="true">
|
|
<cfheader name="Cache-Control" value="max-age=3600">
|
|
|
|
<cfscript>
|
|
/**
|
|
* Get list of address types
|
|
* GET: /api/addresses/types.cfm
|
|
* Returns: { OK: true, TYPES: [{ ID: 1, Label: "Billing" }, ...] }
|
|
*/
|
|
|
|
try {
|
|
qTypes = queryExecute("
|
|
SELECT tt_AddressTypeID as ID, tt_AddressType as Label
|
|
FROM tt_AddressTypes
|
|
ORDER BY tt_AddressTypeID
|
|
", {}, { datasource: "payfrit" });
|
|
|
|
types = [];
|
|
for (row in qTypes) {
|
|
arrayAppend(types, {
|
|
"ID": row.ID,
|
|
"Label": row.Label
|
|
});
|
|
}
|
|
|
|
writeOutput(serializeJSON({
|
|
"OK": true,
|
|
"TYPES": types
|
|
}));
|
|
|
|
} catch (any e) {
|
|
writeOutput(serializeJSON({
|
|
"OK": false,
|
|
"ERROR": "server_error",
|
|
"MESSAGE": e.message
|
|
}));
|
|
}
|
|
</cfscript>
|