/
IvanRyabchenko
/
random-coffee-admin
Обзор
Документация
Войти
/
IvanRyabchenko
/
random-coffee-admin
Код
Запросы
1
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/api/categories.ts
21 строка
668 B
Ivan Ryabchenko
feat(products): add products management page with table, add/delete and pagination
16 май 2026, 19:43
16 май 2026, 19:43
d56a51e
Код
Авторство
О чём код?
import apiClient from './axios-instance' import type { Category, CreateCategoryDto, PaginatedResponse } from '@/types' export async function getCategories( page: number, limit: number ): Promise<PaginatedResponse<Category>> { const response = await apiClient.get<PaginatedResponse<Category>>('/categories', { params: { page, limit }, }) return response.data } export async function createCategory(dto: CreateCategoryDto): Promise<Category> { const response = await apiClient.post<Category>('/categories', dto) return response.data } export async function deleteCategory(id: string): Promise<void> { await apiClient.delete(`/categories/${id}`) }