From 863e717c057a503ccb0ab5d9d45b80c747afdf3b Mon Sep 17 00:00:00 2001 From: keyan Date: Fri, 26 Aug 2022 20:27:57 -0500 Subject: [PATCH] fix broken comments --- api/resolvers/item.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/resolvers/item.js b/api/resolvers/item.js index 77461d36..402af06a 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -877,7 +877,7 @@ export const updateItem = async (parent, { id, data: { title, url, text, boost, throw new UserInputError(`boost must be at least ${BOOST_MIN}`, { argumentName: 'boost' }) } - if (title.length > MAX_TITLE_LENGTH) { + if (!parentId && title.length > MAX_TITLE_LENGTH) { throw new UserInputError('title too long') } @@ -910,7 +910,7 @@ const createItem = async (parent, { title, url, text, boost, forward, parentId } throw new UserInputError(`boost must be at least ${BOOST_MIN}`, { argumentName: 'boost' }) } - if (title.length > MAX_TITLE_LENGTH) { + if (!parentId && title.length > MAX_TITLE_LENGTH) { throw new UserInputError('title too long') }