feat(client): profile improvements
Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { postAuthExchangeMutation } from "@/client/@tanstack/react-query.gen";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { toast } from "sonner";
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import { toast } from 'sonner';
|
||||
import { postAuthExchangeMutation } from '@/client/@tanstack/react-query.gen';
|
||||
|
||||
export function useExchangeToken() {
|
||||
return useMutation({
|
||||
@@ -10,7 +10,7 @@ export function useExchangeToken() {
|
||||
},
|
||||
onError: (error) => {
|
||||
console.error(error);
|
||||
toast("An error occurred while exchanging the token. Please login manually.");
|
||||
}
|
||||
})
|
||||
toast('An error occurred while exchanging the token. Please login manually.');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { postAuthMagicMutation } from '@/client/@tanstack/react-query.gen';
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import { postAuthMagicMutation } from '@/client/@tanstack/react-query.gen';
|
||||
|
||||
export function useGetMagicLink() {
|
||||
return useMutation({
|
||||
...postAuthMagicMutation()
|
||||
})
|
||||
...postAuthMagicMutation(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getUserInfoQueryKey, patchUserUpdateMutation } from '@/client/@tanstack/react-query.gen';
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { getUserInfoQueryKey, patchUserUpdateMutation } from '@/client/@tanstack/react-query.gen';
|
||||
|
||||
export function useUpdateUser() {
|
||||
const queryClient = useQueryClient();
|
||||
@@ -8,5 +8,5 @@ export function useUpdateUser() {
|
||||
onSuccess: async () => {
|
||||
await queryClient.invalidateQueries({ queryKey: getUserInfoQueryKey() });
|
||||
},
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { getUserInfoOptions } from '@/client/@tanstack/react-query.gen';
|
||||
import { useSuspenseQuery } from '@tanstack/react-query';
|
||||
import { getUserInfoOptions } from '@/client/@tanstack/react-query.gen';
|
||||
|
||||
export function useUserInfo() {
|
||||
return useSuspenseQuery({
|
||||
...getUserInfoOptions(),
|
||||
staleTime: 10 * 60 * 1000
|
||||
staleTime: 10 * 60 * 1000,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user