mirror of
https://github.com/strapi/strapi.git
synced 2025-07-27 10:56:36 +00:00
21 lines
543 B
JavaScript
21 lines
543 B
JavaScript
![]() |
'use strict';
|
||
|
|
||
|
const { yup, validateYupSchemaSync } = require('@strapi/utils');
|
||
|
|
||
|
const MAX_LOGO_SIZE = 1024 * 1024; // 1Mo
|
||
|
const ALLOWED_LOGO_FILE_TYPES = ['image/jpeg', 'image/png', 'image/svg+xml'];
|
||
|
|
||
|
const updateProjectSettings = yup
|
||
|
.object({
|
||
|
menuLogo: yup.object({
|
||
|
name: yup.string().max(255),
|
||
|
type: yup.string().oneOf(ALLOWED_LOGO_FILE_TYPES),
|
||
|
size: yup.number().max(MAX_LOGO_SIZE),
|
||
|
}),
|
||
|
})
|
||
|
.noUnknown();
|
||
|
|
||
|
module.exports = {
|
||
|
validateUpdateProjectSettings: validateYupSchemaSync(updateProjectSettings),
|
||
|
};
|