mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Follow @Tirokk's PR review suggestions
- add type :User to match - remove unneeded outdated pinPost
This commit is contained in:
parent
9f70012556
commit
8872dc16cf
@ -233,11 +233,10 @@ export default {
|
|||||||
let writeTxResultPromise = session.writeTransaction(async transaction => {
|
let writeTxResultPromise = session.writeTransaction(async transaction => {
|
||||||
const deletePreviousRelationsResponse = await transaction.run(
|
const deletePreviousRelationsResponse = await transaction.run(
|
||||||
`
|
`
|
||||||
MATCH ()-[previousRelations:PINNED]->(post:Post)
|
MATCH (:User)-[previousRelations:PINNED]->(post:Post)
|
||||||
DELETE previousRelations
|
DELETE previousRelations
|
||||||
RETURN post
|
RETURN post
|
||||||
`,
|
`,
|
||||||
{ params },
|
|
||||||
)
|
)
|
||||||
return deletePreviousRelationsResponse.records.map(record => record.get('post').properties)
|
return deletePreviousRelationsResponse.records.map(record => record.get('post').properties)
|
||||||
})
|
})
|
||||||
@ -276,7 +275,7 @@ export default {
|
|||||||
const writeTxResultPromise = session.writeTransaction(async transaction => {
|
const writeTxResultPromise = session.writeTransaction(async transaction => {
|
||||||
const unpinPostTransactionResponse = await transaction.run(
|
const unpinPostTransactionResponse = await transaction.run(
|
||||||
`
|
`
|
||||||
MATCH ()-[previousRelations:PINNED]->(post:Post {id: $params.id})
|
MATCH (:User)-[previousRelations:PINNED]->(post:Post {id: $params.id})
|
||||||
DELETE previousRelations
|
DELETE previousRelations
|
||||||
RETURN post
|
RETURN post
|
||||||
`,
|
`,
|
||||||
|
|||||||
@ -759,7 +759,7 @@ describe('UpdatePost', () => {
|
|||||||
variables = { ...variables, id: 'only-pinned-post' }
|
variables = { ...variables, id: 'only-pinned-post' }
|
||||||
await mutate({ mutation: pinPostMutation, variables })
|
await mutate({ mutation: pinPostMutation, variables })
|
||||||
pinnedPost = await neode.cypher(
|
pinnedPost = await neode.cypher(
|
||||||
`MATCH ()-[pinned:PINNED]->(post:Post) RETURN post, pinned`,
|
`MATCH (:User)-[pinned:PINNED]->(post:Post) RETURN post, pinned`,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -200,7 +200,6 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
pinPost() {},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user