From 99ef303c4de384149caf3a09038b219c3b849265 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Tue, 18 Feb 2020 09:21:15 +0100 Subject: [PATCH] Move logout link to sidebar --- .../src/components/profile/ProfileSidebar.vue | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/client/src/components/profile/ProfileSidebar.vue b/client/src/components/profile/ProfileSidebar.vue index db7dfc1e..0a562ba8 100644 --- a/client/src/components/profile/ProfileSidebar.vue +++ b/client/src/components/profile/ProfileSidebar.vue @@ -7,11 +7,15 @@
Meine Aktivitäten
- - Klasse +
+ Klassenliste +
Zugangscode eingeben
+
+ Logout +
@@ -21,6 +25,7 @@ import SIDEBAR from '@/graphql/gql/local/sidebar.gql'; import TOGGLE_SIDEBAR from '@/graphql/gql/local/mutations/toggleSidebar.gql'; + import LOGOUT_MUTATION from '@/graphql/gql/mutations/logoutUser.gql'; export default { components: { @@ -36,6 +41,15 @@ open: false } }); + }, + logout() { + this.$apollo.mutate({ + mutation: LOGOUT_MUTATION, + }).then(({data}) => { + if (data.logout.success) { + location.replace('/logout') + } + }); } },