mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-24 11:47:24 +02:00
♻️ Improve query invalidation (#659)
This commit is contained in:
parent
0ad5abb590
commit
5b6d8424af
6 changed files with 21 additions and 26 deletions
|
@ -22,8 +22,10 @@ export const DeletePollForm: React.FunctionComponent<{
|
|||
const confirmationText = watch("confirmation");
|
||||
const canDelete = confirmationText === confirmText;
|
||||
const posthog = usePostHog();
|
||||
const queryClient = trpc.useContext();
|
||||
const deletePoll = trpc.polls.delete.useMutation({
|
||||
onSuccess: () => {
|
||||
queryClient.polls.invalidate();
|
||||
posthog?.capture("deleted poll");
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue