diff --git a/src/features/Well/components/Well/WellDetail.tsx b/src/features/Well/components/Well/WellDetail.tsx index 3c33f171..31bef470 100644 --- a/src/features/Well/components/Well/WellDetail.tsx +++ b/src/features/Well/components/Well/WellDetail.tsx @@ -75,7 +75,6 @@ function WellDetail({ order: newOrder, }); - console.log(prevChanges); setOrderChanges(prevChanges); setItems((prevItems) => { diff --git a/src/features/Well/components/Well/WellItem/WellItemList.tsx b/src/features/Well/components/Well/WellItem/WellItemList.tsx index f5e0e41f..6bcb776b 100644 --- a/src/features/Well/components/Well/WellItem/WellItemList.tsx +++ b/src/features/Well/components/Well/WellItem/WellItemList.tsx @@ -59,7 +59,7 @@ const WellItemList = React.memo( handleMoveItem, }: Props) => { const { wellItemCount, isLoading: isWellItemCountLoading } = - useWellItemCount(userId); + useWellItemCount(userId, isRootUser); const { baseFrogsCount } = useUserFrogsCount(); const isGotFirstFrog = localStorage.getItem(STORAGE_KEY.gotFirstFrog); diff --git a/src/features/Well/hooks/useWellItemCount.ts b/src/features/Well/hooks/useWellItemCount.ts index 7c31c52e..1eb8490d 100644 --- a/src/features/Well/hooks/useWellItemCount.ts +++ b/src/features/Well/hooks/useWellItemCount.ts @@ -2,11 +2,11 @@ import { useQuery } from '@tanstack/react-query'; import { getUserWellItemsCount } from '../api/well.api'; import { QUERY_KEY } from '@/constants/query'; -export const useWellItemCount = (userId: string) => { +export const useWellItemCount = (userId: string, isRootUser: boolean) => { const { data, isLoading } = useQuery({ queryKey: [QUERY_KEY.wellItemCount, userId], queryFn: () => getUserWellItemsCount(userId), - enabled: !!userId, + enabled: !!userId && isRootUser, }); return {