From eef355a791cc90fe347565333e40692dbf762e02 Mon Sep 17 00:00:00 2001 From: ZareMate <0.zaremate@gmail.com> Date: Thu, 26 Mar 2026 23:03:58 +0100 Subject: [PATCH] fix(sellable): update addSellable function to use availableItems and enhance logging --- src/components/new_items.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/new_items.tsx b/src/components/new_items.tsx index d349305e..0c2acfb4 100644 --- a/src/components/new_items.tsx +++ b/src/components/new_items.tsx @@ -109,10 +109,17 @@ export default function SellableItemsButton({ const addSellable = async () => { if (selectedIndex === null || price === "" || amount === "") return; - const item = items[selectedIndex]; + const item = availableItems[selectedIndex]; if (!item) return; + console.log("Adding sellable", { + shopId: item.shop.id, + itemId: item.item_name, + price, + amount, + }); + const res = await fetch("/api/sellable", { method: "POST", headers: { "Content-Type": "application/json" }, @@ -272,7 +279,7 @@ export default function SellableItemsButton({

)} -
+
{Object.entries(sellablesByShop).map(([shopId, items]) => (