mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Change the register site so that it loads community information if their is none.
This commit is contained in:
parent
7f1b4c22a4
commit
35b01d9010
@ -161,6 +161,7 @@ import InputEmail from '../../components/Inputs/InputEmail.vue'
|
||||
import InputPasswordConfirmation from '../../components/Inputs/InputPasswordConfirmation.vue'
|
||||
import LanguageSwitchSelect from '../../components/LanguageSwitchSelect.vue'
|
||||
import { registerUser } from '../../graphql/mutations'
|
||||
import { communityInfo } from '../../graphql/queries'
|
||||
|
||||
export default {
|
||||
components: { InputPasswordConfirmation, InputEmail, LanguageSwitchSelect },
|
||||
@ -228,6 +229,20 @@ export default {
|
||||
this.form.password.passwordRepeat = ''
|
||||
this.language = ''
|
||||
},
|
||||
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)
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
namesFilled() {
|
||||
@ -242,6 +257,9 @@ export default {
|
||||
return this.form.email !== ''
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.onCreated()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style></style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user