From ce4842f375080f2d337d59bb474ed348eed42357 Mon Sep 17 00:00:00 2001 From: Cristian Felipe Cruz Buitron Date: Sat, 29 Aug 2026 18:59:48 +0000 Subject: [PATCH] fix(commerce-backend): corregir tipo de callback en location_levels.find TS2769: la anotacion explicita {location_id: string} no calzaba con el tipo Maybe que infiere query.graph para location_levels. Se quita la anotacion y se deja inferir, con optional chaining. --- .../commerce-backend/src/api/admin/inventory-panel/route.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workloads/commerce-backend/src/api/admin/inventory-panel/route.ts b/workloads/commerce-backend/src/api/admin/inventory-panel/route.ts index 1f50c4e..087bc44 100644 --- a/workloads/commerce-backend/src/api/admin/inventory-panel/route.ts +++ b/workloads/commerce-backend/src/api/admin/inventory-panel/route.ts @@ -49,7 +49,7 @@ export async function GET(req: MedusaRequest, res: MedusaResponse) { const variant = product.variants?.[0]; const inventoryItem = variant?.inventory_items?.[0]; const level = inventoryItem?.inventory?.location_levels?.find( - (level: { location_id: string }) => level.location_id === locationId, + (candidate) => candidate?.location_id === locationId, ); return { productId: product.id, @@ -131,7 +131,7 @@ export async function POST(req: MedusaRequest, res: MedusaRespo } if (typeof quantity === "number" && inventoryItemId) { const level = inventoryItem?.inventory?.location_levels?.find( - (level: { location_id: string }) => level.location_id === locationId, + (candidate) => candidate?.location_id === locationId, ); await updateInventoryLevelsWorkflow(req.scope).run({ input: {