authApi.ts 466 B

12345678910111213141516171819
  1. import { AccountInfo } from "../services/auth/types";
  2. import { Area } from "../services/product/type";
  3. import { BaseApi } from "./baseApi";
  4. class AuthApi extends BaseApi {
  5. constructor() {
  6. super("/auth");
  7. }
  8. async requestOtp({ email }) {
  9. return this.authPost("/request-otp", { email });
  10. }
  11. async verifyOtp({ email, otp }) {
  12. return this.authPost<AccountInfo>("/verify-otp", { email, otpCode: otp });
  13. }
  14. }
  15. export const authApi = new AuthApi();