Skip to content

Commit

Permalink
fix: useGetMyWktHistoryQuery에 refetch 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
maylh committed Aug 18, 2024
1 parent df8e6c5 commit 68f6873
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const UserWkHistoryPage = () => {
| null
>(null);

const { data, isLoading, isError, fetchNextPage, hasNextPage } =
const { data, isLoading, isError, fetchNextPage, hasNextPage, refetch } =
useGetMyWktHistoryQuery({
statuses: param.type.join(','),
startDate: startDate
Expand All @@ -78,7 +78,9 @@ const UserWkHistoryPage = () => {

const { mutate: patchWktStatus } = usePatchWktStatusMutation({
wktId: selectedWorkationId || 0,
successCallback: () => {},
successCallback: () => {
refetch();
},
errorCallback: (error) => {
alert(`에러가 발생했습니다 : ${error.message}`);
},
Expand All @@ -88,6 +90,7 @@ const UserWkHistoryPage = () => {
successCallback: () => {
alert('신청이 취소되었습니다.');
setIsCancelModalOpen(false);
refetch();
},
errorCallback: (error) => {
alert(`에러가 발생했습니다 : ${error.message}`);
Expand Down

0 comments on commit 68f6873

Please sign in to comment.