Merge pull request #1316 from Human-Connection/1315-fix_unique_constraint_bug_when_merging_a_new_hashtag

Fix #1315
This commit is contained in:
mattwr18 2019-08-21 09:34:18 +02:00 committed by GitHub
commit a6cb159a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ const updateHashtagsOfPost = async (postId, hashtags, context) => {
const cypherCreateNewTagsAndRelations = ` const cypherCreateNewTagsAndRelations = `
MATCH (p: Post { id: $postId}) MATCH (p: Post { id: $postId})
UNWIND $hashtags AS tagName UNWIND $hashtags AS tagName
MERGE (t: Tag { id: tagName, name: tagName, disabled: false, deleted: false }) MERGE (t: Tag { id: tagName, disabled: false, deleted: false })
MERGE (p)-[:TAGGED]->(t) MERGE (p)-[:TAGGED]->(t)
RETURN p, t RETURN p, t
` `