chore: unused types and functions removed, api url moved to .env
This commit is contained in:
3
.env
3
.env
@@ -1,2 +1,3 @@
|
||||
VITE_GOOGLE_CLIENT_ID=https://272098283932-bft2gvlgjn8edopg0lnqjq1i9ekdmipt.apps.googleusercontent.com/
|
||||
VITE_DEFUALT_AUTH_RETURN_URL=/setting/profile
|
||||
VITE_DEFUALT_AUTH_RETURN_URL=/setting/profile
|
||||
VITE_API_URL=https://accounts.business-harmony.com/api/
|
||||
@@ -1,7 +1,5 @@
|
||||
import type { ApiResponse } from '@/types/apiResponse';
|
||||
import type { FetchPromise } from '@/types/fetchPromise';
|
||||
import type {
|
||||
CompleteUserInformationRequest,
|
||||
ConfirmEmailOtpRequest,
|
||||
ConfirmForgetPassCodeRequest,
|
||||
ConfirmOtpResponse,
|
||||
@@ -79,12 +77,6 @@ export const loginOrSignUpWithGoogle = async (
|
||||
);
|
||||
};
|
||||
|
||||
export const completeUserInformation = async (
|
||||
body: CompleteUserInformationRequest,
|
||||
) => {
|
||||
return apiClient.post<ApiResponse>('User/CompleteUserInformation', body);
|
||||
};
|
||||
|
||||
export const logOut = async () => {
|
||||
return apiClient.post<ApiResponse>('User/LogOut', {});
|
||||
};
|
||||
|
||||
@@ -115,24 +115,3 @@ export interface LoginOrSignUpWithGoogleResponse extends ApiResponse {
|
||||
completedUserInformation: boolean;
|
||||
returnUrl: string;
|
||||
}
|
||||
|
||||
// CompleteUserInformation
|
||||
|
||||
export interface CompleteUserInformationRequest {
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
gender?: Gender;
|
||||
nationalCode?: string;
|
||||
savePassword?: boolean;
|
||||
password?: string;
|
||||
saveEmail?: boolean;
|
||||
email?: string;
|
||||
birthDate?: string;
|
||||
countryCode?: string;
|
||||
userId?: GUID;
|
||||
}
|
||||
|
||||
export enum Gender {
|
||||
Male = 1,
|
||||
Female = 2,
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ const getToken = () => sessionStorage.getItem('authToken');
|
||||
|
||||
const apiClient = axios.create({
|
||||
// Define the base URL for all API requests
|
||||
baseURL: 'https://accounts.business-harmony.com/api/',
|
||||
baseURL: import.meta.env.VITE_API_URL,
|
||||
|
||||
// Set a timeout for requests (e.g., 10 seconds)
|
||||
timeout: 10000,
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
export type FetchPromise<T = ''> = Promise<FetchResponse<T>>;
|
||||
|
||||
export interface FetchResponse<T> extends Response {
|
||||
json(): Promise<T>;
|
||||
}
|
||||
Reference in New Issue
Block a user