mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
552-update_comment
This commit is contained in:
parent
8c7009097a
commit
a5f6390f97
@ -7,7 +7,9 @@ const validateUsername = async (resolve, root, args, context, info) => {
|
||||
/* eslint-disable-next-line no-return-await */
|
||||
return await resolve(root, args, context, info)
|
||||
} else {
|
||||
throw new UserInputError(`Username must be at least ${USERNAME_MIN_LENGTH} characters long!`)
|
||||
throw new UserInputError(
|
||||
`Username must be at least ${USERNAME_MIN_LENGTH} characters long!`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,8 +37,7 @@ const validateComment = async (resolve, root, args, context, info) => {
|
||||
if (!postId) {
|
||||
throw new UserInputError(NO_POST_ERR_MESSAGE)
|
||||
}
|
||||
|
||||
return await resolve(root, args, context, info)
|
||||
return resolve(root, args, context, info)
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import { neo4jgraphql } from 'neo4j-graphql-js'
|
||||
import { UserInputError } from 'apollo-server'
|
||||
|
||||
const NO_POST_ERR_MESSAGE = 'Comment cannot be created without a post!'
|
||||
|
||||
export default {
|
||||
Mutation: {
|
||||
CreateComment: async (object, params, context, resolveInfo) => {
|
||||
@ -52,13 +54,7 @@ export default {
|
||||
return comment
|
||||
},
|
||||
UpdateComment: async (object, params, context, resolveInfo) => {
|
||||
const commentRev = await neo4jgraphql(
|
||||
object,
|
||||
params,
|
||||
context,
|
||||
resolveInfo,
|
||||
false
|
||||
)
|
||||
await neo4jgraphql(object, params, context, resolveInfo, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,4 +104,4 @@
|
||||
"vue-jest": "~3.0.4",
|
||||
"vue-svg-loader": "~0.12.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user