skillbox/client/src/mixins/me.js

42 lines
763 B
JavaScript

import ME_QUERY from '@/graphql/gql/meQuery.gql';
export default {
data() {
return {
me: {
selectedClass: {
id: ''
},
permissions: [],
schoolClasses: [],
isTeacher: false
},
showPopover: false
}
},
computed: {
topicRoute() {
if (this.me.lastTopic && this.me.lastTopic.slug) {
return {
name: 'topic',
params: {
topicSlug: this.me.lastTopic.slug
}
}
}
return '/book/topic/berufliche-grundbildung'
}
},
apollo: {
me: {
query: ME_QUERY,
update(data) {
return this.$getRidOfEdges(data).me;
},
fetchPolicy: 'cache-first'
},
},
}