Skip to content

Commit

Permalink
fix: Add min(1) requirement for addresses and statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyi committed Oct 3, 2019
1 parent a60da1e commit 7685c27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ const DEFAULT_STATUSES = ['FAILURE'];
const SCHEMA_ADDRESS = Joi.string().email();
const SCHEMA_ADDRESSES = Joi.array()
.items(SCHEMA_ADDRESS)
.min(0);
.min(1);
const SCHEMA_STATUS = Joi.string().valid(Object.keys(COLOR_MAP));
const SCHEMA_STATUSES = Joi.array()
.items(SCHEMA_STATUS)
.min(0);
.min(1);
const SCHEMA_EMAIL = Joi.alternatives().try(
Joi.object().keys({ addresses: SCHEMA_ADDRESSES, statuses: SCHEMA_STATUSES }),
SCHEMA_ADDRESS, SCHEMA_ADDRESSES
Expand Down

0 comments on commit 7685c27

Please sign in to comment.