Skip to content

Commit

Permalink
chore/#416 : 실수로 날린 코드 백업
Browse files Browse the repository at this point in the history
  • Loading branch information
moondda committed Sep 3, 2024
1 parent b33329d commit da9b4ee
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/pages/admin/hooks/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,25 @@ export const useFetchGroupInfo = (groupId: string) => {
return data;
};

//모임 정보 삭제
export const useDeleteGroup = (groupId: string) => {
const queryClient = useQueryClient();
const navigate = useNavigate();
const { mutate, isError, isPending } = useMutation({
mutationKey: [QUERY_KEY_ADMIN.deleteGroup, groupId],
mutationFn: () => deleteGroup(groupId),
onSuccess: () => {
//key에 대한 정책을 변경해야함, 현재는 key의 unique함은 보장되어있지만 관련성이 적어 key의 역할을 제대로 못하고있음
queryClient.invalidateQueries({
queryKey: [QUERY_KEY_GROUPFEED.fetchHeaderGroup],
});
navigate('/');
},
});

return { mutate, isError, isPending };
};

//모임 정보 수정
export const usePutAdminGroupInfo = ({
groupName,
Expand Down

0 comments on commit da9b4ee

Please sign in to comment.