diff --git a/lib/validate.js b/lib/validate.js index 86b03bded..ffdcd759e 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -478,7 +478,7 @@ export const bioSchema = object({ export const inviteSchema = object({ gift: intValidator.positive('must be greater than 0').required('required'), - limit: intValidator.positive('must be positive'), + limit: intValidator.positive('must be positive').nullable(), description: string().trim().max(40, 'must be at most 40 characters'), id: string().matches(/^[\w-_]+$/, 'only letters, numbers, underscores, and hyphens').min(8, 'must be at least 8 characters').max(32, 'must be at most 32 characters') }) diff --git a/pages/invites/index.js b/pages/invites/index.js index 7692c9d2e..e5020a809 100644 --- a/pages/invites/index.js +++ b/pages/invites/index.js @@ -57,7 +57,7 @@ function InviteForm () { variables: { id: id || undefined, gift: Number(gift), - limit: limit ? Number(limit) : limit, + limit: limit ? Number(limit) : null, description: description || undefined } })