Pierre Noël abcaa7f831 add PUT /admin/roles/:id
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-08 10:51:46 +02:00

21 lines
444 B
JavaScript

'use strict';
const { yup, formatYupErrors } = require('strapi-utils');
const handleReject = error => Promise.reject(formatYupErrors(error));
const roleUpdateSchema = yup
.object()
.shape({
description: yup.string(),
})
.noUnknown();
const validateRoleUpdateInput = data => {
return roleUpdateSchema.validate(data, { strict: true, abortEarly: false }).catch(handleReject);
};
module.exports = {
validateRoleUpdateInput,
};