11 lines
332 B
TypeScript
11 lines
332 B
TypeScript
import axios from "axios";
|
|
|
|
export const sendEmailVerification = (setIsLoading: (isLoading: boolean) => void, onSuccess: () => void, onError: (e: Error) => void) => {
|
|
setIsLoading(true);
|
|
axios
|
|
.post<{ok: boolean}>("/api/reset/sendVerification", {})
|
|
.then(onSuccess)
|
|
.catch(onError)
|
|
.finally(() => setIsLoading(false));
|
|
};
|