Alexandre Bodin 90408d5119 content-manager: list content types on kind
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-01-21 11:46:38 +01:00

25 lines
449 B
JavaScript

'use strict';
const yup = require('yup');
const createModelConfigurationSchema = require('./model-configuration');
const TYPES = ['singleType', 'collectionType'];
/**
* Validates type kind
*/
const validateKind = kind => {
return yup
.string()
.oneOf(TYPES)
.nullable()
.validate(kind);
// .catch(error => Promise.reject(formatYupErrors(error)));
};
module.exports = {
createModelConfigurationSchema,
validateKind,
};