Make about optional for folds

This commit is contained in:
jahooma 2022-01-27 12:55:16 -06:00
parent d2e78eb5de
commit 6696ac2a15
2 changed files with 4 additions and 5 deletions

View File

@ -30,9 +30,8 @@ export const createFold = functions.runWith({ minInstances: 1 }).https.onCall(
name = name.trim().slice(0, 140)
if (!about || typeof about !== 'string')
return { status: 'error', message: 'About must be a non-empty string' }
if (typeof about !== 'string')
return { status: 'error', message: 'About must be a string' }
about = about.trim().slice(0, 140)
if (!_.isArray(tags))

View File

@ -57,7 +57,7 @@ export function CreateFoldButton() {
}}
submitBtn={{
label: 'Create',
className: clsx(name && about ? 'btn-primary' : 'btn-disabled'),
className: clsx(name ? 'btn-primary' : 'btn-disabled'),
}}
onSubmit={onSubmit}
>
@ -95,7 +95,7 @@ export function CreateFoldButton() {
</label>
<input
placeholder="Short description (140 characters max)"
placeholder="Short description (140 characters max, optional)"
className="input input-bordered resize-none"
disabled={isSubmitting}
value={about}