Internal: Fix delete simple

pull/3570/head
Julio Montoya 4 years ago
parent 0539c10850
commit af63d72c6a
  1. 5
      assets/vue/store/modules/crud.js
  2. 7
      assets/vue/views/documents/List.vue

@ -88,16 +88,11 @@ export default function makeCrudModule({
.catch(e => handleError(commit, e));
},
delMultiple: ({ commit }, items) => {
console.log('delete items');
commit(ACTIONS.TOGGLE_LOADING);
const promises = items.map(async item => {
const result = await service.del(item).then(() => {
//commit(ACTIONS.TOGGLE_LOADING);
commit(ACTIONS.SET_DELETED_MULTIPLE, item);
console.log(item.title);
console.log('item deleted');
});
return result;

@ -137,7 +137,7 @@
<b-button size="sm" @click="selectAllRows">{{ $t('Select all') }}</b-button>
<b-button size="sm" @click="clearSelected">{{ $t('Clear selected') }}</b-button>
<b-button v-if="this.selected.length > 0" variant="danger" size="sm" @click="deleteSelected">
{{ $t('Delete ...') }}
{{ $t('Delete') }}
</b-button>
</p>
</b-col>
@ -224,7 +224,7 @@ export default {
this.deleteItem(item);
}*/
this.deleteItem(this.selected);
this.delMultiple(this.selected);
this.onUpdateOptions(this.options);
/*const promises = this.selected.map(async item => {
@ -255,7 +255,8 @@ export default {
// From ListMixin
...mapActions('documents', {
getPage: 'fetchAll',
deleteItem: 'delMultiple'
deleteItem: 'del',
deleteMultipleItem: 'delMultiple'
}),
...mapActions('resourcenode', {
findResourceNode: 'findResourceNode',

Loading…
Cancel
Save