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) name = name.trim().slice(0, 140)
if (!about || typeof about !== 'string') if (typeof about !== 'string')
return { status: 'error', message: 'About must be a non-empty string' } return { status: 'error', message: 'About must be a string' }
about = about.trim().slice(0, 140) about = about.trim().slice(0, 140)
if (!_.isArray(tags)) if (!_.isArray(tags))

View File

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