mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Call apollo query to get the countPendingCreations value. added an update to the store of this value, call it when overview is created.
This commit is contained in:
parent
9e45a21687
commit
296d916f1a
7
admin/src/graphql/getCountPendingCreations.js
Normal file
7
admin/src/graphql/getCountPendingCreations.js
Normal file
@ -0,0 +1,7 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const countPendingCreations = gql`
|
||||
query {
|
||||
countPendingCreations
|
||||
}
|
||||
`
|
||||
@ -76,7 +76,24 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { countPendingCreations } from '../graphql/getCountPendingCreations'
|
||||
|
||||
export default {
|
||||
name: 'overview',
|
||||
methods: {
|
||||
getCountPendingCreation() {
|
||||
this.$apollo
|
||||
.query({
|
||||
query: countPendingCreations,
|
||||
})
|
||||
.then((result) => {
|
||||
this.$store.commit('setOpenCreations', result.data.countPendingCreations)
|
||||
})
|
||||
.catch()
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getCountPendingCreation()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -18,6 +18,9 @@ export const mutations = {
|
||||
token: (state, token) => {
|
||||
state.token = token
|
||||
},
|
||||
setOpenCreations: (state, openCreations) => {
|
||||
state.openCreations = openCreations
|
||||
},
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user