Files
scheduler-front/src/network/AccountNetwork.ts
Hyang-Dan 9173556204
All checks were successful
Test CI / build (push) Successful in 19s
issue # 이메일 인증 api 주소 수정
2025-12-14 20:02:37 +09:00

97 lines
2.2 KiB
TypeScript

import {
CheckDuplicationRequest,
SendVerificationCodeRequest,
VerifyCodeRequest,
SignupRequest,
LoginRequest,
SendResetPasswordCodeRequest,
VerifyResetPasswordCodeRequest,
ResetPasswordRequest
} from "@/data/request";
import {
CheckDuplicationResponse,
SendVerificationCodeResponse,
VerifyCodeResponse,
SignupResponse,
LoginResponse,
SendResetPasswordCodeResponse,
VerifyResetPasswordCodeResponse,
ResetPasswordResponse
} from "@/data/response";
import { BaseNetwork } from "./BaseNetwork";
export class AccountNetwork extends BaseNetwork {
private baseUrl = "/account";
async checkDuplication(data: CheckDuplicationRequest) {
const { type, value } = data;
return await this.get<CheckDuplicationResponse>(
`${this.baseUrl}/check-duplication?type=${type}&value=${value}`
, {
authPass: true
}
);
}
async sendVerificationCode(data: SendVerificationCodeRequest) {
return await this.post<SendVerificationCodeResponse>(
this.baseUrl + "/send-email-verification-code"
, data
, {
authPass: true
}
);
}
async verifyCode(data: VerifyCodeRequest) {
return await this.post<VerifyCodeResponse>(
this.baseUrl + "/verify-email-verification-code"
, data
, {
authPass: true
}
);
}
async signup(data: SignupRequest) {
return await this.post<SignupResponse>(
this.baseUrl + "/signup"
, data
, {
authPass: true
}
);
}
async login(data: LoginRequest) {
return await this.post<LoginResponse>(
this.baseUrl + "/login"
, data
, {
authPass: true
}
);
}
async sendResetPasswordCode(data: SendResetPasswordCodeRequest) {
return await this.post<SendResetPasswordCodeResponse>(
this.baseUrl + '/send-reset-password-code',
data
);
}
async verifyResetPasswordCode(data: VerifyResetPasswordCodeRequest) {
return await this.post<VerifyResetPasswordCodeResponse>(
this.baseUrl + '/verify-reset-password-code',
data
);
}
async resetPassword(data: ResetPasswordRequest) {
return await this.post<ResetPasswordResponse>(
this.baseUrl + '/reset-password',
data
);
}
}