Documents: fix delete

pull/3890/head
Julio Montoya 4 years ago
parent e967e3c6d8
commit 815f8ac5ac
  1. 17
      assets/vue/mixins/UpdateMixin.js
  2. 1
      assets/vue/store/modules/crud.js

@ -14,7 +14,7 @@ export default {
},
};
},
mounted() {
created() {
console.log('mounted');
// Changed
let id = this.$route.params.id;
@ -35,6 +35,7 @@ export default {
retrieved() {
// call from list
console.log('update mixin retrieved');
let id = this.$route.params.id;
console.log('first');
console.log(id);
@ -44,10 +45,16 @@ export default {
console.log(id);
}
let item = this.find(decodeURIComponent(id));
console.log(item);
if (!isEmpty(id)) {
let item = this.find(decodeURIComponent(id));
if (isEmpty(item)) {
this.retrieve(decodeURIComponent(id));
}
return item;
}
return item;
//return this.find(decodeURIComponent(this.$route.params.id));
}
@ -57,6 +64,7 @@ export default {
console.log(this.retrieved);
this.deleteItem(this.retrieved).then(() => {
console.log('deleteItem resykt');
let folderParams = this.$route.query;
//this.showMessage(`${this.item['@id']} deleted.`);
this.$router
@ -80,6 +88,7 @@ export default {
updateForm.v$.$touch();
if (!updateForm.v$.$invalid) {
this.update(updateForm.v$.item.$model);
this.item = { ...this.retrieved };
}
},

@ -150,6 +150,7 @@ export default function makeCrudModule({
{ commit },
{ params = { properties: ['@id', 'name'] } } = {}
) => {
console.log('fetchSelectItems');
commit(ACTIONS.TOGGLE_LOADING);
if (!service) throw new Error('No service specified!');

Loading…
Cancel
Save