From 238cba0c0427d27467fe19fa39b196ab87f5b5cc Mon Sep 17 00:00:00 2001 From: nico-iaco Date: Tue, 22 Oct 2024 15:39:24 +0100 Subject: [PATCH] fix item apis --- src/component/ChooseFoodTransactionComponent.tsx | 3 +-- src/page/itemTransaction/ItemTransactionPage.tsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/component/ChooseFoodTransactionComponent.tsx b/src/component/ChooseFoodTransactionComponent.tsx index 706ead4..46af88c 100644 --- a/src/component/ChooseFoodTransactionComponent.tsx +++ b/src/component/ChooseFoodTransactionComponent.tsx @@ -3,7 +3,7 @@ import {setCurrentItem, setCurrentTransaction, setError} from "../action/Action" import {SimpleItemRowComponent} from "./SimpleItemRowComponent"; import {useDispatch, useSelector} from "react-redux"; import {StepperComponentProps} from "../page/addFoodConsumption/AddFoodConsumptionPage"; -import {getCurrentItem, getCurrentPantry, getCurrentTransaction, getUser} from "../selector/Selector"; +import {getCurrentItem, getCurrentPantry, getCurrentTransaction} from "../selector/Selector"; import {Transaction} from "../model/transaction"; import {format} from "date-fns"; import {useTransactionList} from "../hooks/useTransactionList"; @@ -13,7 +13,6 @@ import {strings} from "../localization/strings"; const ChooseFoodTransactionComponent = (props: StepperComponentProps) => { const dispatch = useDispatch(); const currentFood = useSelector(getCurrentItem); - const currentUser = useSelector(getUser); const currentPantry = useSelector(getCurrentPantry); const currentTransaction = useSelector(getCurrentTransaction); const transactionList = useTransactionList(currentPantry?.id || "", currentFood?.id || "", true); diff --git a/src/page/itemTransaction/ItemTransactionPage.tsx b/src/page/itemTransaction/ItemTransactionPage.tsx index d19c766..28d8495 100644 --- a/src/page/itemTransaction/ItemTransactionPage.tsx +++ b/src/page/itemTransaction/ItemTransactionPage.tsx @@ -18,7 +18,7 @@ function ItemTransactionPage() { const currentItem = useSelector(getCurrentItem); const currentPantry = useSelector(getCurrentPantry); const itemTransactionList = useTransactionList(currentPantry?.id || "", currentItem?.id || "", false); - const itemDetails = useItemDetail(currentPantry?.id || "", currentPantry?.id || ""); + const itemDetails = useItemDetail(currentItem?.id || "", currentPantry?.id || ""); const goToAddTransactionPage = () => { navigate(`/item/${currentItem?.id}/transaction/add`);