Remove vuex

This commit is contained in:
2022-02-10 15:49:21 +00:00
parent 8b0e368d58
commit c693625e34
21 changed files with 322 additions and 351 deletions

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { REGISTER } from "../store/action-types";
import { useSessionStore } from '../stores/session';
export default defineComponent({
data() {
@ -15,11 +15,11 @@ export default defineComponent({
}
},
methods: {
formSubmit (e) {
formSubmit (e : FormDataEvent) {
e.preventDefault();
this.$store.dispatch(REGISTER, this.$data.login)
useSessionStore().register(this.$data.login)
.then(() => this.$data.error = "")
.catch(() => this.$data.error = ["Something went wrong!"]);
.catch(() => this.$data.error = "Something went wrong!");
// TODO display invalidCredentials
// TODO redirect to dashboard on success