feat: login and register, otp verify api calls added

This commit is contained in:
مهرزاد قدرتی
2025-08-09 15:46:51 +03:30
parent 284e60fab3
commit cd86254ce1
12 changed files with 403 additions and 59 deletions

View File

@@ -1,6 +1,7 @@
import type { ApiResponse } from '@/types/apiResponse';
import type { FetchPromise } from '@/types/fetchPromise';
import type {
CompleteUserInformationRequest,
ConfirmEmailOtpRequest,
ConfirmForgetPassCodeRequest,
ConfirmOtpResponse,
@@ -18,7 +19,7 @@ import type {
SendSmsOtpRequest,
} from '../types/userTypes';
const API_URL = 'https://account.business-harmony.com/api/';
const API_URL = 'https://account.business-harmony.com/api';
export const fetchRequest = <T = ApiResponse>(
url: string,
@@ -91,6 +92,12 @@ export const loginOrSignUpWithGoogle = async (
);
};
export const completeUserInformation = async (
body: CompleteUserInformationRequest,
) => {
return fetchRequest<ApiResponse>('User/CompleteUserInformation', body);
};
export const logOut = async () => {
return fetchRequest<ApiResponse>('User/LogOut', {});
};