Skip to content

Commit

Permalink
Merge pull request #1391 from hypersign-protocol/develop
Browse files Browse the repository at this point in the history
fixed the action update bug
  • Loading branch information
Vishwas1 authored Jun 27, 2022
2 parents 2d2ad35 + f6da649 commit 132874b
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions src/views/admin/Events.vue
Original file line number Diff line number Diff line change
Expand Up @@ -721,15 +721,32 @@ export default {
case "UPDATE": {
const { id, _id } = data;
this.eventActionList.map((x) => {
if (x._id === _id || x.id === id) {
return data;
let actionIndex = -1;
if (_id){
actionIndex = this.eventActionList.findIndex(
(x) => x._id == data._id
);
} else if (id){
actionIndex = this.eventActionList.findIndex(
(x) => x.id == data.id
);
}
});
if (actionIndex > -1){
this.eventActionList.splice(actionIndex, 1);
this.eventActionList.push(data)
} else {
console.log('error in updating actionIndex = ', actionIndex)
}
// this.eventActionList.map((x) => {
// if (x._id == _id || x.id == id) {
// return data;
// }
// });
break;
}
case "DELETE": {
case "DELETE": {
if (data._id) {
const actionIndex = this.eventActionList.findIndex(
(x) => x._id == data._id
Expand Down

0 comments on commit 132874b

Please sign in to comment.