UNPKG

566 BJavaScriptView Raw
1const Joi = require("@hapi/joi");
2
3const id = Joi.number().min(1);
4const user_id = Joi.number().min(1);
5const organization_id = Joi.number().min(1);
6const data = Joi.object();
7
8module.exports = {
9 list: options =>
10 Joi.object({
11 user_id,
12 organization_id
13 }).validate(options),
14
15 show: options =>
16 Joi.object({
17 id: id.required()
18 }).validate(options),
19
20 create: options =>
21 Joi.object({
22 data: data.required()
23 }).validate(options),
24
25 delete: options =>
26 Joi.object({
27 id: id.required()
28 }).validate(options)
29};