Refactor: Put id in data.resource object

This commit is contained in:
Robert Schäfer 2019-03-10 12:23:53 +01:00
parent 173c2c3281
commit 7d7a1be43d
2 changed files with 5 additions and 7 deletions

View File

@ -86,7 +86,9 @@ describe('DisableModal.vue', () => {
beforeEach(() => {
propsData = {
isOpen: true,
id: 4711
resource: {
id: 4711
}
}
})

View File

@ -33,14 +33,10 @@ export default {
type: Boolean,
default: false
},
id: {
type: Number,
default: null
},
resource: {
type: Object,
default() {
return { type: 'contribution', name: '' }
return { id: null, type: 'contribution', name: '' }
}
}
},
@ -62,7 +58,7 @@ export default {
disable(id: $id)
}
`,
variables: { id: this.id }
variables: { id: this.resource.id }
})
this.$toast.success(this.$t('disable.success'))
} catch (err) {