feat: Categories retrieve + list API (#7009)
This commit is contained in:
@@ -1,18 +1,24 @@
|
||||
import {
|
||||
ProductCollectionListRes,
|
||||
ProductCollectionRes,
|
||||
} from "../../types/api-responses"
|
||||
AdminProductCategoryListResponse,
|
||||
AdminProductCategoryResponse,
|
||||
} from "@medusajs/types"
|
||||
import { getRequest } from "./common"
|
||||
|
||||
async function listProductCategories(query?: Record<string, any>) {
|
||||
return getRequest<ProductCollectionListRes>(`/admin/categories`, query)
|
||||
return getRequest<AdminProductCategoryListResponse>(
|
||||
`/admin/product-categories`,
|
||||
query
|
||||
)
|
||||
}
|
||||
|
||||
async function retrieveProductCategory(
|
||||
id: string,
|
||||
query?: Record<string, any>
|
||||
) {
|
||||
return getRequest<ProductCollectionRes>(`/admin/categories/${id}`, query)
|
||||
return getRequest<AdminProductCategoryResponse>(
|
||||
`/admin/product-categories/${id}`,
|
||||
query
|
||||
)
|
||||
}
|
||||
|
||||
export const categories = {
|
||||
|
||||
Reference in New Issue
Block a user