From 0229f356e36f9aa3cb90353c967a4376586983aa Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Sat, 13 Jun 2020 13:04:24 +0200 Subject: [PATCH] - Finished methods to delete and update a spell, reactive components --- client/babel.config.js | 6 +++--- .../src/components/spells/edit-spell-card.vue | 11 ++--------- client/src/components/spells/spell-card.vue | 18 +++++++++++++++++- client/src/components/spells/spells-list.vue | 15 ++++++++++++--- 4 files changed, 34 insertions(+), 16 deletions(-) diff --git a/client/babel.config.js b/client/babel.config.js index 2d47eef..d470020 100644 --- a/client/babel.config.js +++ b/client/babel.config.js @@ -1,5 +1,5 @@ module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset' - ], + presets: [ + '@vue/cli-plugin-babel/preset' + ], } diff --git a/client/src/components/spells/edit-spell-card.vue b/client/src/components/spells/edit-spell-card.vue index 264d3c1..082ba5b 100644 --- a/client/src/components/spells/edit-spell-card.vue +++ b/client/src/components/spells/edit-spell-card.vue @@ -55,7 +55,6 @@ @@ -171,16 +170,10 @@ export default { } Spells.updateSpell(this.spell.id, data) - .then(() => { - this.$refs["edit_spell_modal"].hide() + .then(v => { + this.$emit('updateSpell', v.data) }) }, - deleteSpell() { - Spells.deleteSpell(this.spell.id) - .then(() => { - this.$refs["edit_spell_modal"].hide() - }) - } } } diff --git a/client/src/components/spells/spell-card.vue b/client/src/components/spells/spell-card.vue index ac5ed6c..eec3f94 100644 --- a/client/src/components/spells/spell-card.vue +++ b/client/src/components/spells/spell-card.vue @@ -1,7 +1,6 @@