Reorder model root attribute and remove multiple key

This commit is contained in:
Aurelsicoko 2018-04-24 16:19:02 +02:00
parent 1c03f63465
commit 1618d3f858
2 changed files with 4 additions and 4 deletions

View File

@ -115,13 +115,13 @@ module.exports = {
try {
const modelJSON = _.cloneDeep(require(modelFilePath));
modelJSON.attributes = formatedAttributes;
modelJSON.connection = connection;
modelJSON.collectionName = collectionName;
modelJSON.info = {
name,
description
};
modelJSON.connection = connection;
modelJSON.collectionName = collectionName;
modelJSON.attributes = formatedAttributes;
const clearRelationsErrors = Service.clearRelations(model, plugin);

View File

@ -177,7 +177,7 @@ module.exports = {
_.forEach(attributesConfigurable, attribute => {
if (_.has(attribute, 'params.type')) {
attrs[attribute.name] = attribute.params;
attrs[attribute.name] = _.omit(attribute.params, 'multiple');
if (attribute.params.type === 'media') {
const via = _.findKey(strapi.plugins.upload.models.file.attributes, {collection: '*'});