Skip to content

Commit

Permalink
Merge pull request #284 from BCSDLab/hotFix/#256-2/price-input-bug-fix
Browse files Browse the repository at this point in the history
hotFix: refech로 회귀
  • Loading branch information
hoooooony authored Apr 18, 2024
2 parents 0dc5a64 + 736bf6d commit 96c86f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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

0 comments on commit 96c86f1

Please sign in to comment.