changes
This commit is contained in:
@@ -14,33 +14,17 @@ export const useStore = defineStore("maindev", {
|
||||
branch: {},
|
||||
rights: [],
|
||||
product: [],
|
||||
selectedImeis: [],
|
||||
}),
|
||||
actions: {
|
||||
commit(name, data) {
|
||||
// console.trace("commit", name, data);
|
||||
this[name] = data;
|
||||
},
|
||||
|
||||
updateProduct(products) {
|
||||
this.product = products;
|
||||
},
|
||||
|
||||
updateSingleProduct(updatedProduct) {
|
||||
const index = this.product.findIndex((p) => p.id === updatedProduct.id);
|
||||
if (index !== -1) {
|
||||
this.product[index] = updatedProduct;
|
||||
} else {
|
||||
this.product.push(updatedProduct);
|
||||
}
|
||||
},
|
||||
|
||||
removeProduct(productId) {
|
||||
this.product = this.product.filter((p) => p.id !== productId);
|
||||
},
|
||||
},
|
||||
|
||||
persist: {
|
||||
pick: ["token", "login", "lang"],
|
||||
pick: ["token", "login", "lang", "selectedImeis"],
|
||||
storage: piniaPluginPersistedstate.localStorage(),
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user