Skip to content

Commit b9505a7

Browse files
Add custom Joi functions
1 parent efc74e3 commit b9505a7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/services/ProcessorService.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const helper = require('../common/helper')
99
const config = require('config')
1010
const moment = require('moment')
1111

12+
Joi.optionalId = () => Joi.string().uuid()
13+
Joi.id = () => Joi.optionalId().required()
14+
1215
const client = helper.getESClient()
1316

1417
const intOrUUID = () => Joi.alternatives().try(Joi.number().integer().min(1), Joi.string().uuid())

0 commit comments

Comments
 (0)