feat(backend): create/update post with post type

This commit is contained in:
Moriz Wahl 2023-03-29 16:02:44 +02:00
parent 84811d8937
commit 6d377ecaaa
3 changed files with 7 additions and 0 deletions

View File

@ -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)

View File

@ -0,0 +1,4 @@
enum PostType {
Article
Event
}

View File

@ -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