fix broken comments

This commit is contained in:
keyan 2022-08-26 20:27:57 -05:00
parent 5b2cfd11cc
commit 863e717c05
1 changed files with 2 additions and 2 deletions

View File

@ -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' }) 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') 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' }) 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') throw new UserInputError('title too long')
} }