feat(client): checkin

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2026-02-08 17:16:18 +08:00
parent 79ccd0036e
commit a315eea087
16 changed files with 211 additions and 186 deletions

View File

@@ -1,8 +1,21 @@
import { useMutation } from '@tanstack/react-query';
import { postEventJoinMutation } from '@/client/@tanstack/react-query.gen';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import {
getEventJoinedInfiniteQueryKey,
getEventListInfiniteQueryKey,
postEventJoinMutation,
} from '@/client/@tanstack/react-query.gen';
export function useJoinEvent() {
const queryClient = useQueryClient();
return useMutation({
...postEventJoinMutation(),
onSuccess: () => {
void queryClient.invalidateQueries({
queryKey: getEventListInfiniteQueryKey(),
});
void queryClient.invalidateQueries({
queryKey: getEventJoinedInfiniteQueryKey(),
});
},
});
}