feat: safe-top and search

This commit is contained in:
2025-08-08 12:27:47 +03:00
parent 4ae8d59328
commit a8bb5eb493
13 changed files with 82 additions and 19 deletions

View File

@@ -7,6 +7,7 @@ export const useProductsStore = defineStore('products', {
data: [],
meta: {},
},
search: '',
page: 1,
isLoading: false,
loadFinished: false,
@@ -22,6 +23,7 @@ export const useProductsStore = defineStore('products', {
return await ftch('products', {
categoryId: categoryId,
page: page,
search: this.search,
});
} catch (error) {
console.error(error);
@@ -31,6 +33,7 @@ export const useProductsStore = defineStore('products', {
},
reset() {
this.isLoading = false;
this.page = 1;
this.hasMore = true;
this.loadFinished = false;
@@ -38,6 +41,6 @@ export const useProductsStore = defineStore('products', {
data: [],
meta: {},
};
}
},
},
});