mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
Add allowedTypes in media type meta
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
32c021db37
commit
c4bf0cdb67
@ -86,6 +86,7 @@ const formatAttribute = (key, attribute, { model }) => {
|
||||
type: 'media',
|
||||
multiple: attribute.collection ? true : false,
|
||||
required: attribute.required ? true : false,
|
||||
allowedTypes: attribute.allowedTypes,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
|
||||
@ -29,9 +29,7 @@ const hasComponent = model => {
|
||||
const isConfigurable = attribute => _.get(attribute, 'configurable', true);
|
||||
|
||||
const isRelation = attribute =>
|
||||
_.has(attribute, 'target') ||
|
||||
_.has(attribute, 'model') ||
|
||||
_.has(attribute, 'collection');
|
||||
_.has(attribute, 'target') || _.has(attribute, 'model') || _.has(attribute, 'collection');
|
||||
|
||||
/**
|
||||
* Formats a component's attributes
|
||||
@ -57,9 +55,7 @@ const formatAttribute = (key, attribute, { model }) => {
|
||||
if (_.has(attribute, 'type')) return attribute;
|
||||
|
||||
// format relations
|
||||
const relation = (model.associations || []).find(
|
||||
assoc => assoc.alias === key
|
||||
);
|
||||
const relation = (model.associations || []).find(assoc => assoc.alias === key);
|
||||
const { plugin, configurable } = attribute;
|
||||
let targetEntity = attribute.model || attribute.collection;
|
||||
|
||||
@ -69,6 +65,7 @@ const formatAttribute = (key, attribute, { model }) => {
|
||||
multiple: attribute.collection ? true : false,
|
||||
required: attribute.required ? true : false,
|
||||
configurable: configurable === false ? false : undefined,
|
||||
allowedTypes: attribute.allowedTypes,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user