Files
scheduler-front/src/network/AccountNetwork.ts
Hyang-Dan b730945d34 issue #37
- 비밀번호 초기화 화면 기능 구현
2025-12-02 22:39:47 +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-verification-code"
, data
, {
authPass: true
}
);
}
async verifyCode(data: VerifyCodeRequest) {
return await this.post<VerifyCodeResponse>(
this.baseUrl + "/verify-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
);
}
}