diff --git a/backend/src/middleware/validation/index.js b/backend/src/middleware/validation/index.js index faf95beaf..a7238ab03 100644 --- a/backend/src/middleware/validation/index.js +++ b/backend/src/middleware/validation/index.js @@ -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 { diff --git a/backend/src/resolvers/comments.js b/backend/src/resolvers/comments.js index f3cfea378..2515ba36a 100644 --- a/backend/src/resolvers/comments.js +++ b/backend/src/resolvers/comments.js @@ -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) } } } diff --git a/webapp/package.json b/webapp/package.json index a3e8b44b9..62007112d 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -104,4 +104,4 @@ "vue-jest": "~3.0.4", "vue-svg-loader": "~0.12.0" } -} \ No newline at end of file +}