mirror of
https://github.com/strapi/strapi.git
synced 2025-11-13 16:52:18 +00:00
Reorder model root attribute and remove multiple key
This commit is contained in:
parent
1c03f63465
commit
1618d3f858
@ -115,13 +115,13 @@ module.exports = {
|
|||||||
try {
|
try {
|
||||||
const modelJSON = _.cloneDeep(require(modelFilePath));
|
const modelJSON = _.cloneDeep(require(modelFilePath));
|
||||||
|
|
||||||
modelJSON.attributes = formatedAttributes;
|
modelJSON.connection = connection;
|
||||||
|
modelJSON.collectionName = collectionName;
|
||||||
modelJSON.info = {
|
modelJSON.info = {
|
||||||
name,
|
name,
|
||||||
description
|
description
|
||||||
};
|
};
|
||||||
modelJSON.connection = connection;
|
modelJSON.attributes = formatedAttributes;
|
||||||
modelJSON.collectionName = collectionName;
|
|
||||||
|
|
||||||
const clearRelationsErrors = Service.clearRelations(model, plugin);
|
const clearRelationsErrors = Service.clearRelations(model, plugin);
|
||||||
|
|
||||||
|
|||||||
@ -177,7 +177,7 @@ module.exports = {
|
|||||||
|
|
||||||
_.forEach(attributesConfigurable, attribute => {
|
_.forEach(attributesConfigurable, attribute => {
|
||||||
if (_.has(attribute, 'params.type')) {
|
if (_.has(attribute, 'params.type')) {
|
||||||
attrs[attribute.name] = attribute.params;
|
attrs[attribute.name] = _.omit(attribute.params, 'multiple');
|
||||||
|
|
||||||
if (attribute.params.type === 'media') {
|
if (attribute.params.type === 'media') {
|
||||||
const via = _.findKey(strapi.plugins.upload.models.file.attributes, {collection: '*'});
|
const via = _.findKey(strapi.plugins.upload.models.file.attributes, {collection: '*'});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user