diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index 6eb1ebbbc..ba982e6ef 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -99,6 +99,10 @@ export default { type: Object, default: () => ({}), }, + groupId: { + type: String, + default: () => null, + }, }, data() { const { title, content, image, categories } = this.contribution @@ -164,6 +168,14 @@ export default { } } this.loading = true + // Wolle: console.log('variables: ', { + // title, + // content, + // categoryIds, + // id: this.contribution.id || null, + // image, + // groupId: this.groupId, + // }) this.$apollo .mutate({ mutation: this.contribution.id ? PostMutations().UpdatePost : PostMutations().CreatePost, @@ -173,6 +185,7 @@ export default { categoryIds, id: this.contribution.id || null, image, + groupId: this.groupId, }, }) .then(({ data }) => { diff --git a/webapp/graphql/PostMutations.js b/webapp/graphql/PostMutations.js index ee61efc3b..23a537e56 100644 --- a/webapp/graphql/PostMutations.js +++ b/webapp/graphql/PostMutations.js @@ -3,8 +3,20 @@ import gql from 'graphql-tag' export default () => { return { CreatePost: gql` - mutation ($title: String!, $content: String!, $categoryIds: [ID], $image: ImageInput) { - CreatePost(title: $title, content: $content, categoryIds: $categoryIds, image: $image) { + mutation ( + $title: String! + $content: String! + $categoryIds: [ID] + $image: ImageInput + $groupId: ID + ) { + CreatePost( + title: $title + content: $content + categoryIds: $categoryIds + image: $image + groupId: $groupId + ) { title slug content @@ -23,14 +35,14 @@ export default () => { $title: String! $content: String! $image: ImageInput - $categoryIds: [ID] + $categoryIds: [ID] # Wolle: $groupId: ID ) { UpdatePost( id: $id title: $title content: $content image: $image - categoryIds: $categoryIds + categoryIds: $categoryIds # Wolle: groupId: $groupId ) { id title diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 6375ca48f..69a1e08b0 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -605,6 +605,12 @@ "submitted": "Kommentar gesendet", "updated": "Änderungen gespeichert" }, + "createNewPost": { + "forGroup": { + "title": "Für die Gruppe „{name}“" + }, + "title": "Erstelle einen neuen Beitrag" + }, "edited": "bearbeitet", "menu": { "delete": "Beitrag löschen", diff --git a/webapp/locales/en.json b/webapp/locales/en.json index aab9c6f83..01c4a1b67 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -605,6 +605,12 @@ "submitted": "Comment submitted!", "updated": "Changes saved!" }, + "createNewPost": { + "forGroup": { + "title": "For The Group “{name}”" + }, + "title": "Create A New Post" + }, "edited": "edited", "menu": { "delete": "Delete post", diff --git a/webapp/pages/group/_id/_slug.vue b/webapp/pages/group/_id/_slug.vue index dd8bccda6..5f4e0b885 100644 --- a/webapp/pages/group/_id/_slug.vue +++ b/webapp/pages/group/_id/_slug.vue @@ -249,10 +249,9 @@ - + - - - - -   - +
+ + {{ $t('post.createNewPost.title') }} + + {{ $t('post.createNewPost.forGroup.title', { name: group.name }) }} + + + + + + + +   + +