Add brand viewing
This commit is contained in:
@@ -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 ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user