Make about optional for folds
This commit is contained in:
parent
d2e78eb5de
commit
6696ac2a15
|
@ -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))
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue
Block a user