Use assign to keep keys that are not extended by default. Set password as required in the CM for u&p

This commit is contained in:
Alexandre Bodin 2021-11-26 11:52:16 +01:00
parent 8125a9d3bc
commit 2baccc96a7

View File

@ -39,7 +39,11 @@ const applyUserExtension = async plugins => {
for (const ctName in plugin.contentTypes) {
const extendedSchema = get([pluginName, 'content-types', ctName, 'schema'], extendedSchemas);
if (extendedSchema) {
plugin.contentTypes[ctName].schema = extendedSchema;
plugin.contentTypes[ctName].schema = Object.assign(
{},
plugin.contentTypes[ctName].schema,
extendedSchema
);
}
}
// second: execute strapi-server extension