added sorting2
This commit is contained in:
@@ -32,12 +32,24 @@ export const brandsApi = baseApi.injectEndpoints({
|
||||
return `/brands/${params}/products`;
|
||||
}
|
||||
|
||||
const { id, page = 1, limit } = params;
|
||||
const { id, page = 1, limit, sorting, min_price, max_price, brands } = params;
|
||||
let url = `/brands/${id}/products?page=${page}`;
|
||||
|
||||
if (limit) {
|
||||
url += `&limit=${limit}`;
|
||||
}
|
||||
if (sorting) {
|
||||
url += `&sorting=${encodeURIComponent(sorting)}`;
|
||||
}
|
||||
if (min_price) {
|
||||
url += `&min_price=${encodeURIComponent(min_price)}`;
|
||||
}
|
||||
if (max_price) {
|
||||
url += `&max_price=${encodeURIComponent(max_price)}`;
|
||||
}
|
||||
if (brands) {
|
||||
url += `&brands=${encodeURIComponent(brands)}`;
|
||||
}
|
||||
|
||||
return url;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user