Add isFruit to fruit object for letting know the API that it's a fruit
This commit is contained in:
@@ -95,7 +95,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fruit: {
|
fruit: {
|
||||||
color: "#000000"
|
color: "#000000",
|
||||||
|
isFruit: true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -111,6 +112,7 @@ export default {
|
|||||||
this.fruit.image = url;
|
this.fruit.image = url;
|
||||||
},
|
},
|
||||||
async checkForm(e) {
|
async checkForm(e) {
|
||||||
|
this.fruit.expires = new Date(this.fruit.expires);
|
||||||
await this.$store
|
await this.$store
|
||||||
.dispatch("addFruit", this.fruit)
|
.dispatch("addFruit", this.fruit)
|
||||||
.then(() => this.$store.commit("toggleModal"));
|
.then(() => this.$store.commit("toggleModal"));
|
||||||
|
|||||||
Reference in New Issue
Block a user