refactor(client): use generated API client and hooks
Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
@@ -1,16 +1,8 @@
|
||||
import type { AuthorizeSearchParams } from '@/routes/authorize';
|
||||
import { postAuthMagicMutation } from '@/client/@tanstack/react-query.gen';
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import { axiosClient } from '@/lib/axios';
|
||||
|
||||
interface GetMagicLinkPayload extends AuthorizeSearchParams {
|
||||
email: string;
|
||||
turnstile_token: string;
|
||||
}
|
||||
|
||||
export function useGetMagicLink() {
|
||||
return useMutation({
|
||||
mutationFn: async (payload: GetMagicLinkPayload) => {
|
||||
return axiosClient.post<{ status: string }>('/auth/magic', payload);
|
||||
},
|
||||
});
|
||||
...postAuthMagicMutation()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user