feat: email verify APIs

This commit is contained in:
2025-06-07 01:33:21 +02:00
parent 5b1ed9925d
commit 644cf2a358

25
web/src/api/verify.ts Normal file
View File

@ -0,0 +1,25 @@
import { axios, handleApiError } from ".";
export const requestEmailOtpApi = async (): Promise<void> => {
const response = await axios.post("/api/v1/auth/email");
if (response.status !== 200 && response.status !== 201)
throw await handleApiError(response);
return response.data;
};
export interface ConfirmEmailRequest {
otp: string;
}
export const confirmEmailApi = async (
req: ConfirmEmailRequest,
): Promise<void> => {
const response = await axios.post("/api/v1/auth/email/otp", req);
if (response.status !== 200 && response.status !== 201)
throw await handleApiError(response);
return response.data;
};