Added mixin to the register community page.

This commit is contained in:
elweyn 2021-10-28 06:50:16 +02:00
parent c0fc927c23
commit cb799ea925

View File

@ -49,32 +49,15 @@
</div> </div>
</template> </template>
<script> <script>
import { communityInfo } from '../../graphql/queries' import { getCommunityInfo } from '../../mixin/getCommunityInfo'
export default { export default {
name: 'registerCommunity', name: 'registerCommunity',
data() { data() {
return {} return {}
}, },
methods: { mixins: [getCommunityInfo],
async onCreated() { methods: {},
if (!this.$state.store.community) {
this.$apollo
.query({
query: communityInfo,
})
.then((result) => {
this.$store.commit('community', result.data.getCommunityInfo)
})
.catch((error) => {
this.$toasted.error(error.message)
})
}
},
},
created() {
this.onCreated()
},
} }
</script> </script>
<style></style> <style></style>