mirror of
https://github.com/strapi/strapi.git
synced 2025-07-28 19:34:51 +00:00
20 lines
417 B
JavaScript
20 lines
417 B
JavaScript
'use strict';
|
|
|
|
const { yup, handleYupError } = require('@strapi/utils');
|
|
|
|
const roleUpdateSchema = yup
|
|
.object()
|
|
.shape({
|
|
name: yup.string().min(1),
|
|
description: yup.string().nullable(),
|
|
})
|
|
.noUnknown();
|
|
|
|
const validateRoleUpdateInput = data => {
|
|
return roleUpdateSchema.validate(data, { strict: true, abortEarly: false }).catch(handleYupError);
|
|
};
|
|
|
|
module.exports = {
|
|
validateRoleUpdateInput,
|
|
};
|