fixed some bugs
This commit is contained in:
@@ -7,13 +7,14 @@ export const categoriesApi = baseApi.injectEndpoints({
|
||||
}),
|
||||
|
||||
getCategoryProducts: builder.query({
|
||||
query: ({ categoryId, page = 1, limit, brands, min_price, max_price }) => {
|
||||
query: ({ categoryId, page = 1, limit, brands, min_price, max_price, sorting }) => {
|
||||
const params = new URLSearchParams();
|
||||
params.append('page', page);
|
||||
if (limit) params.append('limit', limit);
|
||||
if (brands) params.append('brands', brands);
|
||||
if (min_price) params.append('min_price', min_price);
|
||||
if (max_price) params.append('max_price', max_price);
|
||||
if (sorting) params.append('sorting', sorting);
|
||||
|
||||
return `categories/${categoryId}/products?${params.toString()}`;
|
||||
},
|
||||
|
||||
@@ -30,13 +30,14 @@ export const collectionsApi = baseApi.injectEndpoints({
|
||||
}),
|
||||
|
||||
getCollectionProductsPaginated: builder.query({
|
||||
query: ({ collectionId, page = 1, limit = 6, brands, min_price, max_price }) => {
|
||||
query: ({ collectionId, page = 1, limit = 6, brands, min_price, max_price, sorting }) => {
|
||||
const params = new URLSearchParams();
|
||||
params.append('page', page);
|
||||
if (limit) params.append('limit', limit);
|
||||
if (brands) params.append('brands', brands);
|
||||
if (min_price) params.append('min_price', min_price);
|
||||
if (max_price) params.append('max_price', max_price);
|
||||
if (sorting) params.append('sorting', sorting);
|
||||
|
||||
return `/collections/${collectionId}/products?${params.toString()}`;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user