16 lines
371 B
TypeScript
16 lines
371 B
TypeScript
import { useMutation } from '@tanstack/react-query';
|
|
import { axiosClient } from '@/lib/axios';
|
|
|
|
interface GetMagicLinkPayload {
|
|
email: string;
|
|
turnstile_token: string;
|
|
}
|
|
|
|
export function useGetMagicLink() {
|
|
return useMutation({
|
|
mutationFn: async (payload: GetMagicLinkPayload) => {
|
|
return axiosClient.post<object>('/auth/magic', payload);
|
|
},
|
|
});
|
|
}
|