diff --git a/src/api/category.ts b/src/api/category.ts index 34c83932..4f3caf22 100644 --- a/src/api/category.ts +++ b/src/api/category.ts @@ -11,7 +11,7 @@ import { GET_CATEGORY_TYPES_ROUTE, buildGetPublicItemCategoriesRoute, buildGetCategoryRoute, - buildGetItemsByCategoriesRoute, + buildGetItemsInCategoryRoute, } from './routes'; const axios = configureAxios(); @@ -49,7 +49,7 @@ export const buildGetItemsForCategoriesRoute = async ( { API_HOST }: QueryClientConfig, ) => axios - .get(`${API_HOST}/${buildGetItemsByCategoriesRoute(categoryIds)}`) + .get(`${API_HOST}/${buildGetItemsInCategoryRoute(categoryIds)}`) .then(({ data }) => data); // payload: itemId, categoryId diff --git a/src/api/routes.ts b/src/api/routes.ts index 71e6f087..24d504d5 100644 --- a/src/api/routes.ts +++ b/src/api/routes.ts @@ -194,7 +194,7 @@ export const buildGetItemCategoriesRoute = (id: UUID) => `${ITEMS_ROUTE}/${id}/categories`; export const buildGetPublicItemCategoriesRoute = (id: UUID) => `${PUBLIC_PREFIX}/${ITEMS_ROUTE}/${id}/categories`; -export const buildGetItemsByCategoriesRoute = (ids: UUID[]) => +export const buildGetItemsInCategoryRoute = (ids: UUID[]) => `${PUBLIC_PREFIX}/${ITEMS_ROUTE}/with-categories${qs.stringify( { categoryId: ids }, { arrayFormat: 'repeat', addQueryPrefix: true },