From 350eb8f29c91338af67e48e84e2da4d1bdeb30a7 Mon Sep 17 00:00:00 2001 From: abhishek Date: Thu, 3 Sep 2026 14:42:56 +0530 Subject: [PATCH] confirm received --- src/features/store-user/pages/StoreProductsPage.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/features/store-user/pages/StoreProductsPage.tsx b/src/features/store-user/pages/StoreProductsPage.tsx index f2c1792..eddfa7e 100644 --- a/src/features/store-user/pages/StoreProductsPage.tsx +++ b/src/features/store-user/pages/StoreProductsPage.tsx @@ -625,7 +625,12 @@ function RequestsPanel({ rows, isLoading }: { rows: StockRequest[]; isLoading: b * this session its button is gone, even before the list refetches. */ const receive = useMutation({ - mutationFn: (requestid: number) => stockApi.approve(requestid), + // `confirmArrival`, not `approve`. They were the same call until the ladder + // grew an Approved step between asking and arriving; `approve` now means + // "the admin agreed to send it" and moves no stock at all. This button is + // the shop saying the goods are HERE, which is the transition the backend + // credits the ledger off. + mutationFn: (requestid: number) => stockApi.confirmArrival(requestid), onMutate: (requestid) => setDone((set) => new Set(set).add(requestid)), onSettled: async () => { await client.invalidateQueries({ queryKey: queryKeys.stock.all });