mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 02:16:03 +00:00
Improve logic by removing those fields from the options
This commit is contained in:
parent
a8773687cf
commit
d279ae8fa3
@ -104,7 +104,9 @@ module.exports = async cb => {
|
||||
});
|
||||
|
||||
// Don't display fields that are hidden by default like the resetPasswordToken for the model user
|
||||
_.unset(fields, fieldsToRemove);
|
||||
fieldsToRemove.forEach(field => {
|
||||
_.unset(fields, field);
|
||||
});
|
||||
schemaModel.attributes = _.omit(schemaModel.attributes, fieldsToRemove);
|
||||
|
||||
schemaModel.fields = fields;
|
||||
@ -194,7 +196,7 @@ module.exports = async cb => {
|
||||
schemaModel.editDisplay.relations = relationsArray;
|
||||
}
|
||||
|
||||
schemaModel.editDisplay.fields = Object.keys(schemaModel.editDisplay.availableFields).filter(field => !fieldsToRemove.includes(field));
|
||||
schemaModel.editDisplay.fields = Object.keys(schemaModel.editDisplay.availableFields);
|
||||
|
||||
if (plugin) {
|
||||
return _.set(schema.models.plugins, `${plugin}.${name}`, schemaModel);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user