strapi/packages/core/utils/lib/relations.js
2022-08-11 10:20:49 +02:00

17 lines
353 B
JavaScript

'use strict';
const MANY_RELATIONS = ['oneToMany', 'manyToMany'];
const getRelationalFields = (contentType) => {
return Object.keys(contentType.attributes).filter((attributeName) => {
return contentType.attributes[attributeName].type === 'relation';
});
};
module.exports = {
getRelationalFields,
constants: {
MANY_RELATIONS,
},
};