mirror of
https://github.com/IT4Change/gradido.git
synced 2026-01-20 20:01:31 +00:00
Change query logout to mutation, call of mutation instead of query.
This commit is contained in:
parent
2d4f88ce84
commit
4fdc492a6c
@ -154,3 +154,9 @@ export const login = gql`
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const logout = gql`
|
||||
mutation {
|
||||
logout
|
||||
}
|
||||
`
|
||||
|
||||
@ -18,12 +18,6 @@ export const verifyLogin = gql`
|
||||
}
|
||||
`
|
||||
|
||||
export const logout = gql`
|
||||
query {
|
||||
logout
|
||||
}
|
||||
`
|
||||
|
||||
export const transactionsQuery = gql`
|
||||
query($currentPage: Int = 1, $pageSize: Int = 25, $order: Order = DESC) {
|
||||
transactionList(currentPage: $currentPage, pageSize: $pageSize, order: $order) {
|
||||
|
||||
@ -41,7 +41,8 @@
|
||||
import Navbar from '@/components/Menu/Navbar.vue'
|
||||
import Sidebar from '@/components/Menu/Sidebar.vue'
|
||||
import SessionLogoutTimeout from '@/components/SessionLogoutTimeout.vue'
|
||||
import { logout, transactionsQuery } from '@/graphql/queries'
|
||||
import { transactionsQuery } from '@/graphql/queries'
|
||||
import { logout } from '@/graphql/mutations'
|
||||
import ContentFooter from '@/components/ContentFooter.vue'
|
||||
import { FadeTransition } from 'vue2-transitions'
|
||||
import CONFIG from '@/config'
|
||||
@ -75,14 +76,15 @@ export default {
|
||||
methods: {
|
||||
async logout() {
|
||||
this.$apollo
|
||||
.query({
|
||||
query: logout,
|
||||
.mutate({
|
||||
mutation: logout,
|
||||
})
|
||||
.then(() => {
|
||||
this.$store.dispatch('logout')
|
||||
this.$router.push('/login')
|
||||
})
|
||||
.catch(() => {
|
||||
console.log('TESTTEST')
|
||||
this.$store.dispatch('logout')
|
||||
if (this.$router.currentRoute.path !== '/login') this.$router.push('/login')
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user