Fix 'groupQuery' GQL on group edit page

- Fix links 'group/my-groups' to 'my-groups'.
- Fix 'createGroupMutation' to be used as a function on group create page.
This commit is contained in:
Wolfgang Huß 2022-09-18 19:44:40 +02:00
parent bba4ca0fc6
commit c2f7604918
4 changed files with 5 additions and 5 deletions

View File

@ -60,7 +60,7 @@
</ds-space>
</ds-form>
<ds-space centered v-show="!update">
<nuxt-link to="/group/my-groups">zurück</nuxt-link>
<nuxt-link to="/my-groups">zurück</nuxt-link>
</ds-space>
</ds-container>
</div>

View File

@ -143,7 +143,7 @@ export const changeGroupMemberRoleMutation = () => {
// ------ queries
export const groupQuery = (i18n) => {
const lang = i18n.locale().toUpperCase()
const lang = i18n ? i18n.locale().toUpperCase() : 'EN'
return gql`
query ($isMember: Boolean, $id: ID, $slug: String) {
Group(isMember: $isMember, id: $id, slug: $slug) {

View File

@ -33,7 +33,7 @@ export default {
const variables = { name, about, description, groupType, actionRadius, categoryIds }
try {
await this.$apollo.mutate({
mutation: createGroupMutation,
mutation: createGroupMutation(),
variables,
})
this.$toast.success(this.$t('group.group-created'))

View File

@ -12,7 +12,7 @@
</ds-flex-item>
</ds-flex>
<ds-space centered>
<nuxt-link to="/group/my-groups">zurück</nuxt-link>
<nuxt-link to="/my-groups">zurück</nuxt-link>
</ds-space>
</div>
</template>
@ -51,7 +51,7 @@ export default {
Group: [group],
},
} = await client.query({
query: groupQuery(this.$i18n),
query: groupQuery(), // "this.$i18n" is undefined here, so we use default lang
variables: { id },
})
if (group.myRole !== 'owner') {