chore: unused types and functions removed, api url moved to .env

This commit is contained in:
2025-08-15 23:29:39 +03:30
parent 07eb2e7d64
commit e9b43b9e53
5 changed files with 3 additions and 36 deletions

3
.env
View File

@@ -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/

View File

@@ -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', {});
};

View File

@@ -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,
}

View File

@@ -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,

View File

@@ -1,5 +0,0 @@
export type FetchPromise<T = ''> = Promise<FetchResponse<T>>;
export interface FetchResponse<T> extends Response {
json(): Promise<T>;
}