From a95afbf4439a62e2dcdfb0d49900c2e8a2210c11 Mon Sep 17 00:00:00 2001 From: DanielS Date: Fri, 10 Jul 2026 00:45:20 +0200 Subject: [PATCH] fix: attach device_name to order items in API checkout route --- shop/app/api/orders/checkout/route.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shop/app/api/orders/checkout/route.ts b/shop/app/api/orders/checkout/route.ts index 012314b..f8f277b 100644 --- a/shop/app/api/orders/checkout/route.ts +++ b/shop/app/api/orders/checkout/route.ts @@ -76,7 +76,11 @@ export async function POST(request: Request) { type === 'purchase' ? 'one_time' : 'monthly', item.moduleQuantities ); - orderItemsList.push(...itemSnapshot.items); + const itemsWithDevice = itemSnapshot.items.map(i => ({ + ...i, + device_name: item.deviceName + })); + orderItemsList.push(...itemsWithDevice); total += itemSnapshot.total; }