Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotFix: refech로 회귀 #284

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/page/ModifyMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ export default function ModifyMenu() {

assert(menuId != null, 'menuId가 없습니다.');
const navigate = useNavigate();
const { menuData, modifyMenuMutation } = useMenuInfo(Number(menuId));

const { menuData, refetch, modifyMenuMutation } = useMenuInfo(Number(menuId));
useEffect(() => {
refetch();
}, [refetch]);
const goMyShop = () => {
navigate('/');
};
Expand Down
4 changes: 2 additions & 2 deletions src/query/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useAddMenuStore from 'store/addMenu';
const useMenuInfo = (menuId:number) => {
const { resetAddMenuStore } = useAddMenuStore();
const queryClient = useQueryClient();
const { data: menuData } = useQuery(
const { data: menuData, refetch } = useQuery(
{
queryKey: ['menuInfo', menuId],
queryFn: () => getMenu(menuId),
Expand All @@ -22,7 +22,7 @@ const useMenuInfo = (menuId:number) => {
},
});
return {
menuData, modifyMenuMutation, modifyMenuError,
menuData, refetch, modifyMenuMutation, modifyMenuError,
};
};

Expand Down
Loading