Add brand viewing

This commit is contained in:
2026-09-08 11:45:54 +05:30
parent 7e9110b707
commit ef0486829c
3 changed files with 102 additions and 14 deletions
+10 -2
View File
@@ -74,6 +74,9 @@ export const categories = {
update: (id: string, body: Partial<CategoryBody>) =>
api.put<CategoryResponse>(`/categories/${id}`, body).then(r => r.data),
remove: (id: string) =>
api.delete(`/categories/${id}`),
createSubCategory: (categoryId: string, body: SubCategoryBody) =>
api.post(`/categories/${categoryId}/subcategories`, body).then(r => r.data),
@@ -91,9 +94,11 @@ export interface BrandBody {
isActive?: boolean
}
// GET /brands takes no query params and returns a plain array — no server-side
// filtering/pagination exists on the backend.
export const brands = {
list: (params?: PageParams) =>
api.get<PaginatedResponse<BrandResponse>>('/brands', { params }).then(r => r.data),
list: () =>
api.get<BrandResponse[]>('/brands').then(r => r.data),
get: (id: string) =>
api.get<BrandResponse>(`/brands/${id}`).then(r => r.data),
@@ -103,6 +108,9 @@ export const brands = {
update: (id: string, body: Partial<BrandBody>) =>
api.put<BrandResponse>(`/brands/${id}`, body).then(r => r.data),
remove: (id: string) =>
api.delete(`/brands/${id}`),
}
// ─── UOMs ─────────────────────────────────────────────────────────────────────