1 | const Joi = require("@hapi/joi");
|
2 |
|
3 | const id = Joi.number().min(1);
|
4 | const user_id = Joi.number().min(1);
|
5 | const organization_id = Joi.number().min(1);
|
6 | const data = Joi.object();
|
7 |
|
8 | module.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 | };
|