Remove vuex
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user