Commit e2a560d8 authored by esatakpunar's avatar esatakpunar

delete multiple product bug fixed

parent cce6fa5d
...@@ -5,7 +5,6 @@ export default { ...@@ -5,7 +5,6 @@ export default {
name: "App", name: "App",
data() { data() {
return { return {
selected: [],
column: "all", column: "all",
search: "", search: "",
}; };
...@@ -21,6 +20,7 @@ export default { ...@@ -21,6 +20,7 @@ export default {
"getOptions", "getOptions",
"totalCustomers", "totalCustomers",
"getColumn", "getColumn",
"getSelected",
]), ]),
indexofColumn() { indexofColumn() {
return this.dialogHeaders.findIndex( return this.dialogHeaders.findIndex(
...@@ -36,6 +36,15 @@ export default { ...@@ -36,6 +36,15 @@ export default {
this.setOptions(data); this.setOptions(data);
}, },
}, },
selected: {
get() {
return this.getSelected;
},
set(data) {
this.setSelected(data);
},
},
}, },
methods: { methods: {
...mapActions("customers", [ ...mapActions("customers", [
...@@ -47,6 +56,7 @@ export default { ...@@ -47,6 +56,7 @@ export default {
"editCustomer", "editCustomer",
"setOptions", "setOptions",
"searchData", "searchData",
"setSelected",
]), ]),
}, },
created() { created() {
......
...@@ -48,6 +48,10 @@ export default { ...@@ -48,6 +48,10 @@ export default {
commit("setColumn", data); commit("setColumn", data);
}, },
setSelected({ commit }, data) {
commit("setSelected", data);
},
closeDialog({ commit }) { closeDialog({ commit }) {
commit("setDialog", false); commit("setDialog", false);
}, },
...@@ -74,6 +78,7 @@ export default { ...@@ -74,6 +78,7 @@ export default {
itemList.push(item.id); itemList.push(item.id);
}); });
dispatch("deleteCustomer", itemList); dispatch("deleteCustomer", itemList);
dispatch("setSelected", []);
}, },
saveCustomer({ getters, dispatch, commit }) { saveCustomer({ getters, dispatch, commit }) {
......
...@@ -55,4 +55,7 @@ export default { ...@@ -55,4 +55,7 @@ export default {
getColumn(state) { getColumn(state) {
return state.column; return state.column;
}, },
getSelected(state) {
return state.selected;
},
}; };
...@@ -26,4 +26,7 @@ export default { ...@@ -26,4 +26,7 @@ export default {
setPageNumber(state) { setPageNumber(state) {
state.options.page = 1; state.options.page = 1;
}, },
setSelected(state, data) {
state.selected = data;
},
}; };
...@@ -9,4 +9,5 @@ export default () => ({ ...@@ -9,4 +9,5 @@ export default () => ({
totalCustomers: 0, totalCustomers: 0,
search: "", search: "",
column: "all", column: "all",
selected: [],
}); });
...@@ -38,6 +38,5 @@ export default { ...@@ -38,6 +38,5 @@ export default {
}, },
setSelected(state, data) { setSelected(state, data) {
state.selected = data; state.selected = data;
console.log(data);
}, },
}; };
...@@ -345,28 +345,6 @@ ...@@ -345,28 +345,6 @@
} }
], ],
"products": [ "products": [
{
"id": "4f2f31bd-bd77-42bb-b8fd-ce3c26e50aec",
"color": "tan",
"department": "Clothing",
"price": "799.00",
"productName": "Ergonomic Steel Chicken",
"type": "Awesome",
"productDescription": "The automobile layout consists of a front-engine design, with transaxle-type transmissions mounted at the rear of the engine and four wheel drive",
"productMaterial": "Plastic",
"image": "http://loremflickr.com/640/480/food"
},
{
"id": "22a57611-6f0a-4e29-9ac5-6eff3ab4126f",
"color": "silver",
"department": "Sports",
"price": "436.00",
"productName": "Fantastic Steel Pizza",
"type": "Handcrafted",
"productDescription": "New ABC 13 9370, 13.3, 5th Gen CoreA5-8250U, 8GB RAM, 256GB SSD, power UHD Graphics, OS 10 Home, OS Office A & J 2016",
"productMaterial": "Concrete",
"image": "http://loremflickr.com/640/480/food"
},
{ {
"id": "dcf58c25-dee0-46c2-ae83-ee589f6a890c", "id": "dcf58c25-dee0-46c2-ae83-ee589f6a890c",
"color": "olive", "color": "olive",
...@@ -726,42 +704,6 @@ ...@@ -726,42 +704,6 @@
} }
], ],
"customers": [ "customers": [
{
"id": "e1710b07-971b-4665-86ce-75dd1c023db4",
"firstName": "Candelario",
"lastName": "Torphy",
"email": "Juston15@hotmail.com",
"country": "Czech Republic",
"city": "Dunwoody",
"image": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/427.jpg"
},
{
"id": "addb918f-6b06-4055-bb0b-82d63fac7c1d",
"firstName": "Kari",
"lastName": "Ziemann",
"email": "Herman.Dickens@hotmail.com",
"country": "Netherlands",
"city": "Wichita Falls",
"image": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/977.jpg"
},
{
"id": "a36eca87-bc2d-463e-b1b9-aafec2adf11a",
"firstName": "Myra",
"lastName": "Bednar",
"email": "Lina_Beer@hotmail.com",
"country": "United States of America",
"city": "Hoover",
"image": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/75.jpg"
},
{
"id": "61077b91-382b-4164-ba29-415d229b81ea",
"firstName": "Assunta",
"lastName": "Feil",
"email": "Tad83@yahoo.com",
"country": "Pitcairn Islands",
"city": "Towson",
"image": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/673.jpg"
},
{ {
"id": "5d2ddf54-558e-40e5-93c6-6cec71e07c0e", "id": "5d2ddf54-558e-40e5-93c6-6cec71e07c0e",
"firstName": "Dasia", "firstName": "Dasia",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment