Fix null value handling in getActiveCart API

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-01-23 21:39:25 -08:00
parent 6727f42194
commit 186c3fcf68

View file

@ -71,16 +71,16 @@ try {
response["OK"] = true; response["OK"] = true;
response["HAS_CART"] = true; response["HAS_CART"] = true;
response["CART"] = { response["CART"] = {
"OrderID": qCart.OrderID, "OrderID": val(qCart.OrderID),
"OrderUUID": qCart.OrderUUID, "OrderUUID": qCart.OrderUUID ?: "",
"BusinessID": qCart.OrderBusinessID, "BusinessID": val(qCart.OrderBusinessID),
"BusinessName": len(trim(qCart.BusinessName)) ? qCart.BusinessName : "", "BusinessName": len(trim(qCart.BusinessName)) ? qCart.BusinessName : "",
"BusinessOrderTypes": orderTypesArray, "BusinessOrderTypes": orderTypesArray,
"OrderTypeID": qCart.OrderTypeID, "OrderTypeID": val(qCart.OrderTypeID),
"OrderTypeName": orderTypeName, "OrderTypeName": orderTypeName,
"ServicePointID": qCart.OrderServicePointID, "ServicePointID": val(qCart.OrderServicePointID),
"ServicePointName": len(trim(qCart.ServicePointName)) ? qCart.ServicePointName : "", "ServicePointName": len(trim(qCart.ServicePointName)) ? qCart.ServicePointName : "",
"ItemCount": qCart.ItemCount, "ItemCount": val(qCart.ItemCount),
"AddedOn": dateTimeFormat(qCart.OrderAddedOn, "yyyy-mm-dd HH:nn:ss") "AddedOn": dateTimeFormat(qCart.OrderAddedOn, "yyyy-mm-dd HH:nn:ss")
}; };
} else { } else {