fix: search
This commit is contained in:
@@ -32,7 +32,7 @@ export const useSearchStore = defineStore('search', {
|
||||
},
|
||||
|
||||
async fetchProducts(search, page = 1, perPage = 5) {
|
||||
return await ftch('products', {
|
||||
return await ftch('products', null, {
|
||||
page,
|
||||
perPage: perPage,
|
||||
search,
|
||||
@@ -68,13 +68,14 @@ export const useSearchStore = defineStore('search', {
|
||||
this.isLoadingMore = true;
|
||||
this.page++;
|
||||
|
||||
console.debug('[Search] Loading more products for page: ', this.page);
|
||||
|
||||
const response = await ftch('products', null, toRaw({
|
||||
const data = toRaw({
|
||||
page: this.page,
|
||||
perPage: 10,
|
||||
search: this.search,
|
||||
}));
|
||||
});
|
||||
console.debug('[Search] Loading more products: ', data);
|
||||
|
||||
const response = await ftch('products', null, data);
|
||||
|
||||
console.debug('[Search] Search results: ', response);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user