mirror of
https://github.com/Unleash/unleash.git
synced 2024-10-18 20:09:08 +02:00
2bcdb5ec31
By having the controller perform try/catch around the handler function allows us to add extra safety to all our controllers and safeguards that we will always catch exceptions thrown by a controller method.
14 lines
357 B
JavaScript
14 lines
357 B
JavaScript
const joi = require('joi');
|
|
const { nameType } = require('../routes/util');
|
|
|
|
const projectSchema = joi
|
|
.object()
|
|
.keys({
|
|
id: nameType,
|
|
name: joi.string().required(),
|
|
description: joi.string().allow(null).allow('').optional(),
|
|
})
|
|
.options({ allowUnknown: false, stripUnknown: true });
|
|
|
|
module.exports = projectSchema;
|