diff --git a/webapp/graphql/groups.js b/webapp/graphql/groups.js new file mode 100644 index 000000000..2a611f324 --- /dev/null +++ b/webapp/graphql/groups.js @@ -0,0 +1,95 @@ +import gql from 'graphql-tag' + +// ------ mutations + +export const createGroupMutation = gql` + mutation ( + $id: ID + $name: String! + $slug: String + $about: String + $description: String! + $groupType: GroupType! + $actionRadius: GroupActionRadius! + $categoryIds: [ID] + ) { + CreateGroup( + id: $id + name: $name + slug: $slug + about: $about + description: $description + groupType: $groupType + actionRadius: $actionRadius + categoryIds: $categoryIds + ) { + id + name + slug + createdAt + updatedAt + disabled + deleted + about + description + groupType + actionRadius + myRole + } + } +` + +// ------ queries + +export const groupQuery = gql` + query ( + $isMember: Boolean + $id: ID + $name: String + $slug: String + $createdAt: String + $updatedAt: String + $about: String + $description: String + $locationName: String + $first: Int + $offset: Int + $orderBy: [_GroupOrdering] + $filter: _GroupFilter + ) { + Group( + isMember: $isMember + id: $id + name: $name + slug: $slug + createdAt: $createdAt + updatedAt: $updatedAt + about: $about + description: $description + locationName: $locationName + first: $first + offset: $offset + orderBy: $orderBy + filter: $filter + ) { + id + name + slug + createdAt + updatedAt + disabled + deleted + about + description + groupType + actionRadius + myRole + categories { + id + slug + name + icon + } + } + } +` diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 297daa511..07a71dfcf 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -333,15 +333,16 @@ "placeholder": "Schreib etwas Inspirierendes …" }, "error-pages": { - "403-default": "Kein Zugang zu dieser Seite", - "404-default": "Diese Seite konnte nicht gefunden werden", - "500-default": "Internal Server Error", - "503-default": "Dienst steht nicht zur Verfügung", - "back-to-index": "Zurück zur Startseite", - "cannot-edit-post": "Dieser Beitrag kann nicht editiert werden", - "default": "Ein Fehler ist aufgetreten", - "post-not-found": "Dieser Beitrag konnte nicht gefunden werden", - "profile-not-found": "Dieses Profil konnte nicht gefunden werden" + "403-default": "Kein Zugang zu dieser Seite!", + "404-default": "Diese Seite konnte nicht gefunden werden!", + "500-default": "Internal Server Error!", + "503-default": "Dienst steht nicht zur Verfügung!", + "back-to-index": "Zurück zur Startseite!", + "cannot-edit-post": "Dieser Beitrag kann nicht editiert werden!", + "default": "Ein Fehler ist aufgetreten!", + "group-not-found": "Dieses Gruppenprofil konnte nicht gefunden werden!", + "post-not-found": "Dieser Beitrag konnte nicht gefunden werden!", + "profile-not-found": "Dieses Profil konnte nicht gefunden werden!" }, "filter-menu": { "all": "Alle", diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 8499b0290..1b16431e3 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -333,15 +333,16 @@ "placeholder": "Leave your inspirational thoughts …" }, "error-pages": { - "403-default": "Not authorized to this page", - "404-default": "This page could not be found", - "500-default": "Internal Server Error", - "503-default": "Service Unavailable", - "back-to-index": "Back to index page", - "cannot-edit-post": "This post cannot be edited", - "default": "An error occurred", - "post-not-found": "This post could not be found", - "profile-not-found": "This profile could not be found" + "403-default": "Not authorized to this page!", + "404-default": "This page could not be found!", + "500-default": "Internal Server Error!", + "503-default": "Service Unavailable!", + "back-to-index": "Back to index page!", + "cannot-edit-post": "This post cannot be edited!", + "default": "An error occurred!", + "group-not-found": "This group profile could not be found!", + "post-not-found": "This post could not be found!", + "profile-not-found": "This profile could not be found!" }, "filter-menu": { "all": "All", diff --git a/webapp/pages/group/_id.spec.js b/webapp/pages/group/_id.spec.js index aab216569..bafd5c392 100644 --- a/webapp/pages/group/_id.spec.js +++ b/webapp/pages/group/_id.spec.js @@ -5,7 +5,7 @@ const localVue = global.localVue config.stubs['nuxt-child'] = '' -describe('Profile _id.vue', () => { +describe('Group profile _id.vue', () => { let wrapper let Wrapper let mocks diff --git a/webapp/pages/group/_id.vue b/webapp/pages/group/_id.vue index b9bbef83e..047d12d7f 100644 --- a/webapp/pages/group/_id.vue +++ b/webapp/pages/group/_id.vue @@ -9,7 +9,7 @@ import PersistentLinks from '~/mixins/persistentLinks.js' const options = { queryId: gql` query($idOrSlug: ID) { - User(id: $idOrSlug) { + Group(id: $idOrSlug) { id slug } @@ -17,14 +17,14 @@ const options = { `, querySlug: gql` query($idOrSlug: String) { - User(slug: $idOrSlug) { + Group(slug: $idOrSlug) { id slug } } `, - message: 'error-pages.profile-not-found', - path: 'profile', + message: 'error-pages.group-not-found', + path: 'group', } const persistentLinks = PersistentLinks(options)