Perform description length check with checkCollectionDetails()

This commit is contained in:
Serkan Reis 2023-01-08 19:53:58 +03:00
parent fd54468d06
commit ce38980eff

View File

@ -661,6 +661,8 @@ const CollectionCreationPage: NextPage = () => {
if (!collectionDetails) throw new Error('Please fill out the collection details') if (!collectionDetails) throw new Error('Please fill out the collection details')
if (collectionDetails.name === '') throw new Error('Collection name is required') if (collectionDetails.name === '') throw new Error('Collection name is required')
if (collectionDetails.description === '') throw new Error('Collection description is required') if (collectionDetails.description === '') throw new Error('Collection description is required')
if (collectionDetails.description.length > 512)
throw new Error('Collection description cannot exceed 512 characters')
if (uploadDetails?.uploadMethod === 'new' && collectionDetails.imageFile.length === 0) if (uploadDetails?.uploadMethod === 'new' && collectionDetails.imageFile.length === 0)
throw new Error('Collection cover image is required') throw new Error('Collection cover image is required')
if ( if (