only close the post modal when the request succeeds

This commit is contained in:
busti 2019-12-29 22:27:30 +01:00
parent df5a5f4729
commit 0c0b8a79af

View file

@ -28,8 +28,9 @@ export default {
}, },
methods: { methods: {
saveNewItem() { saveNewItem() {
this.$store.dispatch('postItem', this.item); this.$store.dispatch('postItem', this.item).then(() => {
this.$emit('close'); this.$emit('close');
});
} }
} }
}; };