fitst commit

This commit is contained in:
Samandar Turgunboyev
2026-01-28 18:26:50 +05:00
parent 166a55b1e9
commit 124798419b
196 changed files with 26627 additions and 421 deletions

73
screens/home/lib/api.ts Normal file
View File

@@ -0,0 +1,73 @@
import httpClient from '@/api/httpClient';
import { API_URLS } from '@/api/URLs';
import { AxiosResponse } from 'axios';
import {
businessAboutDetailRes,
businessAboutRes,
Categories,
CompanyBody,
CountryBody,
ProductBody,
States,
} from './types';
export const products_api = {
async getProducts(params: {
page?: number;
page_size?: number;
search?: string;
}): Promise<AxiosResponse<ProductBody>> {
const res = await httpClient.get(API_URLS.Get_Products, { params });
return res;
},
async getCompany(params: {
page?: number;
page_size?: number;
search?: string;
}): Promise<AxiosResponse<CompanyBody>> {
const res = await httpClient.get(API_URLS.Get_Company, { params });
return res;
},
async getCountry(params: {
page?: number;
page_size?: number;
search?: string;
}): Promise<AxiosResponse<CountryBody>> {
const res = await httpClient.get(API_URLS.Get_Countries, { params });
return res;
},
async getStates(): Promise<AxiosResponse<States>> {
const res = await httpClient.get(API_URLS.Get_States);
return res;
},
async getCategorys(params?: { parent: number }): Promise<AxiosResponse<Categories>> {
const res = await httpClient.get(API_URLS.Get_Categories, { params });
return res;
},
async getCategoryChild(id: number): Promise<AxiosResponse<Categories>> {
const res = await httpClient.get(API_URLS.Get_Categories_Child(id));
return res;
},
async businessAbout(params: {
country?: string;
district: string;
page?: number;
page_size?: number;
region?: string;
types?: number;
}): Promise<AxiosResponse<businessAboutRes>> {
const res = await httpClient.get(API_URLS.Business_About, { params });
return res;
},
async businessAboutDetail(id: number): Promise<AxiosResponse<businessAboutDetailRes>> {
const res = await httpClient.get(API_URLS.Business_About_Detail(id));
return res;
},
};