Fixed some more Typescript issues

This commit is contained in:
Ferdinand Thiessen 2020-10-29 00:10:45 +01:00
parent 9992ed6f2b
commit 5a4f6939d1
3 changed files with 17 additions and 12 deletions

View File

@ -170,12 +170,11 @@ export default defineComponent({
});
function logout() {
console.log('vor dem logout');
ctx.root.$store.dispatch(
'user/logout',
ctx.root.$store.getters['user/session'].token
);
console.log('nach dem logout');
ctx.root.$store
.dispatch('user/logout', ctx.root.$store.getters['user/session'].token)
.catch(error => {
console.warn(error);
});
}
return {

View File

@ -47,9 +47,13 @@ export default defineComponent({
function doLogin() {
console.log(userid.value, password.value);
ctx.root.$store.dispatch('user/login', {
ctx.root.$store
.dispatch('user/login', {
userid: userid.value,
password: password.value
})
.catch(error => {
console.warn(error);
});
//ctx.root.$router.push({ name: 'main' });
}

View File

@ -37,7 +37,7 @@
</template>
<script lang="ts">
import { computed, defineComponent } from '@vue/composition-api';
import { defineComponent } from '@vue/composition-api';
export default defineComponent({
name: 'Sessions',
props: {
@ -66,7 +66,9 @@ export default defineComponent({
}
function deleteSession(token: string) {
root.$store.dispatch('sessions/deleteSession', token);
root.$store.dispatch('sessions/deleteSession', token).catch(error => {
console.warn(error);
});
}
function isThisSession(token: string) {
return root.$store.getters['user/session'].token == token;