Я просто хочу вставить несколько данных в свою базу данных, используя vuex.
На данный момент он говорит: КОЛОННА НЕ СОГЛАСИТСЯ СЧЕТЧИКОМ ЗНАЧЕНИЯ В СТРОКЕ 1, даже если я вставил только две данные в свою базу данных.
Ниже приведен мой код в store.js, который пытается вставить данные в базу данных.
async addArticle({ commit }, name, address) {
const response = await axios.post('http://localhost:9001/article/add', {
name: name, address: address
});
commit('ADD_ARTICLE', response.data)
}
, а вот мой insert.vue
<template>
<section>
<v-container fluid>
<v-card raised>
<v-card-title
class="display-2 font-weight-bold"
style="border-bottom: green 3px solid"
>NEW ARTICLE</v-card-title>
</v-card>
<v-card raised style="margin-top:10px">
<v-card-text class="headline font-weight-black">
<v-layout>
<v-row align-content="center">
<v-col>
TITLE
<v-text-field
v-model="title"
filled
placeholder="Provide a Title for the article"
prepend-icon="title"
></v-text-field>
</v-col>
<v-col>
SUBHEADER
<v-text-field
v-model="subheader"
filled
placeholder="Provide a description for the article"
prepend-icon="description"
></v-text-field>
</v-col>
</v-row>
</v-layout>
<v-btn color="red white--text" style="margin:10px" @click="passToDB">SUBMIT</v-btn>
</v-card-text>
</v-card>
</v-container>
</section>
</template>
<script>
import { mapActions } from "vuex";
export default {
data() {
return {
title: "",
subheader: ""
};
},
methods: {
...mapActions(["addArticle"]),
passToDB() {
this.addArticle({ name: this.title, address: this.subheader });
}
}
};
</script>
В чем моя ошибка вмой код? Буду признателен за помощь.