diff --git a/backend/src/schema/resolvers/posts.js b/backend/src/schema/resolvers/posts.js index d806f3803..8878ecee0 100644 --- a/backend/src/schema/resolvers/posts.js +++ b/backend/src/schema/resolvers/posts.js @@ -125,6 +125,7 @@ export default { SET post.updatedAt = toString(datetime()) SET post.clickedCount = 0 SET post.viewedTeaserCount = 0 + SET post:${params.postType} WITH post MATCH (author:User {id: $userId}) MERGE (post)<-[:WROTE]-(author) diff --git a/backend/src/schema/types/enum/PostType.gql b/backend/src/schema/types/enum/PostType.gql new file mode 100644 index 000000000..eef80d6ba --- /dev/null +++ b/backend/src/schema/types/enum/PostType.gql @@ -0,0 +1,4 @@ +enum PostType { + Article + Event +} diff --git a/backend/src/schema/types/type/Post.gql b/backend/src/schema/types/type/Post.gql index 6fc7a3215..c36e02c21 100644 --- a/backend/src/schema/types/type/Post.gql +++ b/backend/src/schema/types/type/Post.gql @@ -189,6 +189,7 @@ type Mutation { categoryIds: [ID] contentExcerpt: String groupId: ID + postType: PostType = Article ): Post UpdatePost( id: ID! @@ -200,6 +201,7 @@ type Mutation { visibility: Visibility language: String categoryIds: [ID] + postType: PostType ): Post DeletePost(id: ID!): Post AddPostEmotions(to: _PostInput!, data: _EMOTEDInput!): EMOTED