mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Do not catch issues on user assign at post create
This commit is contained in:
parent
ca076bbcb9
commit
cc5701a193
@ -16,18 +16,15 @@ export default {
|
||||
CreatePost: async (resolve, root, args, context, info) => {
|
||||
const result = await resolve(root, args, context, info)
|
||||
|
||||
try {
|
||||
const session = context.driver.session()
|
||||
await session.run(
|
||||
'MATCH (author:User {id: $userId}), (post:Post {id: $postId}) ' +
|
||||
'MERGE (post)<-[:WROTE]-(author) ' +
|
||||
'RETURN author', {
|
||||
userId: context.user.id,
|
||||
postId: result.id
|
||||
})
|
||||
session.close()
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (err) {}
|
||||
const session = context.driver.session()
|
||||
await session.run(
|
||||
'MATCH (author:User {id: $userId}), (post:Post {id: $postId}) ' +
|
||||
'MERGE (post)<-[:WROTE]-(author) ' +
|
||||
'RETURN author', {
|
||||
userId: context.user.id,
|
||||
postId: result.id
|
||||
})
|
||||
session.close()
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user