How to use the id function from joi
Find comprehensive JavaScript joi.id code examples handpicked from public code repositorys.
76 77 78 79 80 81 82 83 84 85 86
return newAttachments } createAttachment.schema = { currentUser: Joi.any(), challengeId: Joi.id(), attachments: Joi.array().items(Joi.object().keys({ name: Joi.string().required(), url: Joi.string().uri().required(), fileSize: Joi.fileSize(),
44
17
25
+ 10 other calls in file
62 63 64 65 66 67 68 69 70 71 72 73
async function getPhase (phaseId) { return helper.getById('Phase', phaseId) } getPhase.schema = { phaseId: Joi.id() } /** * Update phase.
44
17
25
+ 3 other calls in file
80 81 82 83 84 85 86 87 88 89 90
createChallengeTimelineTemplate.schema = { data: Joi.object().keys({ typeId: Joi.id(), trackId: Joi.id(), timelineTemplateId: Joi.id(), isDefault: Joi.boolean().default(false).required() }).required() }
44
17
25
+ 5 other calls in file
79 80 81 82 83 84 85 86 87 88 89 90
const ret = await helper.getById('ChallengeType', id) return ret } getChallengeType.schema = { id: Joi.id() } /** * Fully update challenge type.
44
17
25
+ 3 other calls in file
69 70 71 72 73 74 75 76 77 78 79 80
async function getTimelineTemplate (timelineTemplateId) { return helper.getById('TimelineTemplate', timelineTemplateId) } getTimelineTemplate.schema = { timelineTemplateId: Joi.id() } /** * Update timeline template.
44
17
25
+ 6 other calls in file
1154 1155 1156 1157 1158 1159 1160 1161 1162 1163
status: Joi.string().valid(_.values(constants.challengeStatuses)), groups: Joi.array().items(Joi.optionalId()).unique(), // gitRepoURLs: Joi.array().items(Joi.string().uri()), terms: Joi.array().items(Joi.object().keys({ id: Joi.id(), roleId: Joi.id() })) }).required(), userToken: Joi.string().required() }
44
17
25
+ 18 other calls in file
1258 1259 1260 1261 1262 1263 1264 1265 1266 1267
groups: Joi.array().items(Joi.optionalId()).unique(), // gitRepoURLs: Joi.array().items(Joi.string().uri()), terms: Joi.array().items( Joi.object().keys({ id: Joi.id(), roleId: Joi.id(), }) ), }) .required(),
44
17
25
+ 59 other calls in file
506 507 508 509 510 511 512 513 514 515 516
} } getGroup.schema = { currentUser: Joi.any(), groupId: Joi.id(), // defined in app-bootstrap criteria: Joi.object().keys({ includeSubGroups: Joi.boolean().default(false), includeParentGroup: Joi.boolean().default(false), flattenGroupIdTree: Joi.boolean().default(false),
14
0
42
+ 9 other calls in file
joi.string is the most popular function in joi (40578 examples)