From b635113843165cc8bb5ae3ba071b57221836bed4 Mon Sep 17 00:00:00 2001 From: Du Peng Date: Fri, 16 Sep 2022 17:58:02 +0200 Subject: [PATCH] (bug) all orders is shown in my orders of admin --- .../src/javascript/components/store/orders-dashboard.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/frontend/src/javascript/components/store/orders-dashboard.tsx b/app/frontend/src/javascript/components/store/orders-dashboard.tsx index 8fa16226c..10b5cd57f 100644 --- a/app/frontend/src/javascript/components/store/orders-dashboard.tsx +++ b/app/frontend/src/javascript/components/store/orders-dashboard.tsx @@ -34,7 +34,7 @@ export const OrdersDashboard: React.FC = ({ currentUser, o const [totalCount, setTotalCount] = useState(0); useEffect(() => { - OrderAPI.index({}).then(res => { + OrderAPI.index({ user_id: currentUser.id }).then(res => { setPageCount(res.total_pages); setTotalCount(res.total_count); setOrders(res.data); @@ -67,7 +67,7 @@ export const OrdersDashboard: React.FC = ({ currentUser, o */ const handlePagination = (page: number) => { if (page !== currentPage) { - OrderAPI.index({ page }).then(res => { + OrderAPI.index({ user_id: currentUser.id, page }).then(res => { setCurrentPage(page); setOrders(res.data); setPageCount(res.total_pages);