From 7d7a1be43db506e20efd3990496aabd00515ea0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Sun, 10 Mar 2019 12:23:53 +0100 Subject: [PATCH] Refactor: Put id in data.resource object --- components/Modal/DisableModal.spec.js | 4 +++- components/Modal/DisableModal.vue | 8 ++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/components/Modal/DisableModal.spec.js b/components/Modal/DisableModal.spec.js index 920122842..272e1e56e 100644 --- a/components/Modal/DisableModal.spec.js +++ b/components/Modal/DisableModal.spec.js @@ -86,7 +86,9 @@ describe('DisableModal.vue', () => { beforeEach(() => { propsData = { isOpen: true, - id: 4711 + resource: { + id: 4711 + } } }) diff --git a/components/Modal/DisableModal.vue b/components/Modal/DisableModal.vue index ceafea7c3..90b13d542 100644 --- a/components/Modal/DisableModal.vue +++ b/components/Modal/DisableModal.vue @@ -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) {