In CreationConfirm.vue number of all open creations and transferred to the store

This commit is contained in:
ogerly 2021-11-26 17:43:24 +01:00
parent a618ac678e
commit 2f6a1a0630
2 changed files with 13 additions and 6 deletions

View File

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

View File

@ -76,21 +76,27 @@
</div> </div>
</template> </template>
<script> <script>
import { countPendingCreations } from '../graphql/getCountPendingCreations' // import { getPendingCreations } from '../graphql/getPendingCreations'
export default { export default {
name: 'overview', name: 'overview',
methods: { methods: {
getCountPendingCreation() { /*
async getPendingCreations() {
this.$apollo this.$apollo
.query({ .query({
query: countPendingCreations, query: getPendingCreations,
}) })
.then((result) => { .then((result) => {
this.$store.commit('setOpenCreations', result.data.countPendingCreations) this.confirmResult = result.data.getPendingCreations
this.$store.commit('resetOpenCreations')
this.$store.commit('openCreationsPlus', Object.keys(this.confirmResult).length)
})
.catch((error) => {
this.$toasted.error(error.message)
}) })
.catch()
}, },
*/
}, },
created() { created() {
this.getCountPendingCreation() this.getCountPendingCreation()