feat: add requestEmailVerification

This commit is contained in:
Derrick Hammer 2024-03-26 15:18:29 -04:00
parent dcd1fdc705
commit db2212ab70
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 14 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import {
PasswordResetVerifyRequest, PasswordResetVerifyRequest,
PingResponse, PingResponse,
postApiAccountPasswordResetRequest, postApiAccountPasswordResetRequest,
postApiAccountVerifyEmailResend,
postApiAuthPing, postApiAuthPing,
RegisterRequest, RegisterRequest,
UploadLimitResponse, UploadLimitResponse,
@ -124,6 +125,19 @@ export class AccountApi {
return this.checkSuccessBool(ret); return this.checkSuccessBool(ret);
} }
public async requestEmailVerification(): Promise<boolean | AccountError> {
let ret: AxiosResponse<void>;
try {
ret = await postApiAccountVerifyEmailResend(this.buildOptions());
} catch (e) {
return new AccountError(
(e as AxiosError).response?.data as string,
(e as AxiosError).response?.status as number,
);
}
return this.checkSuccessBool(ret);
}
public async generateOtp(): Promise< public async generateOtp(): Promise<
boolean | OTPGenerateResponse | AccountError boolean | OTPGenerateResponse | AccountError
> { > {