complated order

This commit is contained in:
Samandar Turgunboyev
2026-02-04 18:29:55 +05:00
parent 4d22e3441c
commit 2535913eb2
19 changed files with 176 additions and 144 deletions

View File

@@ -1,13 +1,13 @@
import { AxiosResponse } from 'axios';
import httpClient from '../httpClient';
import { API_URLS } from '../URLs';
import { Category } from './type';
import { CategoryResult } from './type';
export const category_api = {
async getCategory(params: {
page: number;
page_size: number;
}): Promise<AxiosResponse<Category>> {
}): Promise<AxiosResponse<CategoryResult[]>> {
const res = await httpClient.get(API_URLS.Category, { params });
return res;
},

View File

@@ -9,7 +9,12 @@ export interface Category {
}
export interface CategoryResult {
id: string;
id: number;
name: string;
image: string | null;
product_types: ProductTypes[];
}
export interface ProductTypes {
id: number;
name: string;
}

View File

@@ -12,6 +12,8 @@ export const product_api = {
async list(params: {
page: number;
page_size: number;
product_type_id?: number;
category_id?: number;
}): Promise<AxiosResponse<ProductList>> {
const res = await httpClient.get(`${API_URLS.Product}list/`, { params });
return res;

View File

@@ -204,5 +204,8 @@
"Tez-tez So'raladigan Savollar": "Часто задаваемые вопросы",
"Gastro Market haqida eng ko'p so'raladigan savollarga javoblar": "Ответы на самые часто задаваемые вопросы о Gastro Market",
"Barcha mahsulotlar": "Все товары"
"Barcha mahsulotlar": "Все товары",
"Xatolik yuz berdi: Mahsulot omborxonada yetarli emas": "Произошла ошибка: недостаточно товаров на складе",
"Bu kategoriyada hozircha mahsulot yoq": "В этой категории пока нет товаров",
"Tez orada qoshiladi": "Скоро будет добавлено"
}

View File

@@ -204,5 +204,8 @@ declare const messages: {
"Gastro Market haqida eng ko'p so'raladigan savollarga javoblar": "Gastro Market haqida eng ko'p so'raladigan savollarga javoblar";
'Barcha mahsulotlar': 'Barcha mahsulotlar';
'Xatolik yuz berdi: Mahsulot omborxonada yetarli emas': 'Xatolik yuz berdi: Mahsulot omborxonada yetarli emas';
'Bu kategoriyada hozircha mahsulot yoq': 'Bu kategoriyada hozircha mahsulot yoq';
'Tez orada qoshiladi': 'Tez orada qoshiladi';
};
export default messages;

View File

@@ -200,5 +200,8 @@
"Tez-tez So'raladigan Savollar": "Tez-tez So'raladigan Savollar",
"Gastro Market haqida eng ko'p so'raladigan savollarga javoblar": "Gastro Market haqida eng ko'p so'raladigan savollarga javoblar",
"Barcha mahsulotlar": "Barcha mahsulotlar"
"Barcha mahsulotlar": "Barcha mahsulotlar",
"Xatolik yuz berdi: Mahsulot omborxonada yetarli emas": "Xatolik yuz berdi: Mahsulot omborxonada yetarli emas",
"Bu kategoriyada hozircha mahsulot yoq": "Bu kategoriyada hozircha mahsulot yoq",
"Tez orada qoshiladi": "Tez orada qoshiladi"
}