Follow @Tirokk's PR review suggestions

- add type :User to match
- remove unneeded outdated pinPost
This commit is contained in:
mattwr18 2019-10-18 18:27:20 +02:00
parent 9f70012556
commit 8872dc16cf
3 changed files with 3 additions and 5 deletions

View File

@ -233,11 +233,10 @@ export default {
let writeTxResultPromise = session.writeTransaction(async transaction => {
const deletePreviousRelationsResponse = await transaction.run(
`
MATCH ()-[previousRelations:PINNED]->(post:Post)
MATCH (:User)-[previousRelations:PINNED]->(post:Post)
DELETE previousRelations
RETURN post
`,
{ params },
)
return deletePreviousRelationsResponse.records.map(record => record.get('post').properties)
})
@ -276,7 +275,7 @@ export default {
const writeTxResultPromise = session.writeTransaction(async transaction => {
const unpinPostTransactionResponse = await transaction.run(
`
MATCH ()-[previousRelations:PINNED]->(post:Post {id: $params.id})
MATCH (:User)-[previousRelations:PINNED]->(post:Post {id: $params.id})
DELETE previousRelations
RETURN post
`,

View File

@ -759,7 +759,7 @@ describe('UpdatePost', () => {
variables = { ...variables, id: 'only-pinned-post' }
await mutate({ mutation: pinPostMutation, variables })
pinnedPost = await neode.cypher(
`MATCH ()-[pinned:PINNED]->(post:Post) RETURN post, pinned`,
`MATCH (:User)-[pinned:PINNED]->(post:Post) RETURN post, pinned`,
)
})

View File

@ -200,7 +200,6 @@ export default {
},
})
},
pinPost() {},
},
}
</script>