feat: safe-top and search
This commit is contained in:
@@ -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: {},
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user