Skip to content

Commit

Permalink
refactor: 술잔 편집
Browse files Browse the repository at this point in the history
  • Loading branch information
Charmull committed Nov 11, 2022
1 parent 3f4ef29 commit bfa3fa9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/main/hooks/useMainViewModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ const useMainViewModel = () => {
const data = JSON.parse(msg.data);
switch (data.eventType) {
case "change":
navigate("/drink");
refetch();
break;
case "dispenser01에 술잔이 등록되었습니다":
refetch();
// navigate("/main");
break;
}
};
Expand Down
13 changes: 5 additions & 8 deletions src/mainEdit/hooks/useMainEditModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const useMainEditModel = ({

// 수정하기 버튼 눌렀을 때 실행될 useQuery (Axios), 수정 후 백엔드 서버에서 자동으로 바뀐 값들에 대해 message 전달함 (socket)
const { refetch: updateRefetch } = useQuery(
["patch/updateglass"],
["patch/glass"],
async () => {
const { data: updateData } = await customAxios.patch(
`/glass/${id}`,
Expand All @@ -64,14 +64,11 @@ const useMainEditModel = ({

// 삭제하기 버튼 눌렀을 때 실행될 useQuery (Axios)
const { refetch: delRefetch } = useQuery(
["delete/deleteglass"],
["delete/glass"],
async () => {
const { data: delData } = await customAxios.delete(
`/glass/deleteglass/${id}`,
{
headers: authHeader,
}
);
const { data: delData } = await customAxios.delete(`/glass/${id}`, {
headers: authHeader,
});

return delData;
},
Expand Down

0 comments on commit bfa3fa9

Please sign in to comment.