Changed the register community page so that it loads community informations if not provided.

This commit is contained in:
elweyn 2021-10-25 10:54:21 +02:00
parent 35b01d9010
commit 5febfc337e

View File

@ -49,12 +49,32 @@
</div> </div>
</template> </template>
<script> <script>
import { communityInfo } from '../../graphql/queries'
export default { export default {
name: 'registerCommunity', name: 'registerCommunity',
data() { data() {
return {} return {}
}, },
methods: {}, methods: {
async onCreated() {
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>