From 7ac66a9447c524637e38ddb36dfb55bfb2b14e49 Mon Sep 17 00:00:00 2001 From: Adam Bardsley Date: Tue, 26 Nov 2024 12:01:44 +0000 Subject: [PATCH] Fixing iZettle with no products --- app/api/izettle/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/izettle/route.ts b/app/api/izettle/route.ts index 6b68764e..5e3c3eb0 100644 --- a/app/api/izettle/route.ts +++ b/app/api/izettle/route.ts @@ -26,7 +26,7 @@ export async function POST(request: Request) { // console.log("payload:",payload, payload.products.map((product) => product.category)) const channel = "card-payments" - const tills = payload.products.map((product) => product?.sku) as string[] + const tills = payload?.products?.length > 0 ? payload.products.map((product) => product?.sku) as string[] : ["NOTILL"] const notification = { amount: payload.amount, created: payload.created,