change Overview.vue methods getPendingCreations and store set open pending creations

This commit is contained in:
ogerly 2021-12-02 11:51:06 +01:00
parent 997230b334
commit 56fcd7d445
2 changed files with 8 additions and 6 deletions

View File

@ -74,7 +74,9 @@ export default {
query: getPendingCreations,
})
.then((result) => {
this.$store.commit('resetOpenCreations')
this.confirmResult = result.data.getPendingCreations
this.$store.commit('setOpenCreations', result.data.getPendingCreations.length)
})
.catch((error) => {
this.$toasted.error(error.message)
@ -83,7 +85,6 @@ export default {
},
async created() {
await this.getPendingCreations()
this.$store.commit('openCreationsPlus', Object.keys(this.confirmResult).length)
},
}
</script>

View File

@ -76,24 +76,25 @@
</div>
</template>
<script>
import { countPendingCreations } from '../graphql/getCountPendingCreations'
import { getPendingCreations } from '../graphql/getPendingCreations'
export default {
name: 'overview',
methods: {
getCountPendingCreation() {
getPendingCreations() {
this.$apollo
.query({
query: countPendingCreations,
query: getPendingCreations,
})
.then((result) => {
this.$store.commit('setOpenCreations', result.data.countPendingCreations)
console.log(result.data)
this.$store.commit('setOpenCreations', result.data.getPendingCreations.length)
})
.catch()
},
},
created() {
this.getCountPendingCreation()
this.getPendingCreations()
},
}
</script>