1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/src/lib/services/project-schema.js
Ivar Conradi Østhus 2bcdb5ec31
fix: Controller wraps handler with try/catch (#909)
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.
2021-08-13 10:36:19 +02:00

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;