mirror of
https://github.com/strapi/strapi.git
synced 2025-09-16 03:48:22 +00:00
remove possibility to set collectionName table for a CT or component through that CTB API
This commit is contained in:
parent
7f0877b73f
commit
a933d6c71a
@ -42,13 +42,13 @@ module.exports = function createComponentBuilder() {
|
||||
filename: `${nameToSlug(infos.name)}.json`,
|
||||
});
|
||||
|
||||
const defaultCollectionName = `components_${nameToCollectionName(
|
||||
const collectionName = `components_${nameToCollectionName(
|
||||
infos.category
|
||||
)}_${nameToCollectionName(pluralize(infos.name))}`;
|
||||
|
||||
handler
|
||||
.setUID(uid)
|
||||
.set('collectionName', infos.collectionName || defaultCollectionName)
|
||||
.set('collectionName', collectionName)
|
||||
.set(['info', 'name'], infos.name)
|
||||
.set(['info', 'icon'], infos.icon)
|
||||
.set(['info', 'description'], infos.description)
|
||||
@ -98,7 +98,6 @@ module.exports = function createComponentBuilder() {
|
||||
component
|
||||
.setUID(newUID)
|
||||
.setDir(newDir)
|
||||
.set('collectionName', infos.collectionName)
|
||||
.set(['info', 'name'], infos.name)
|
||||
.set(['info', 'icon'], infos.icon)
|
||||
.set(['info', 'description'], infos.description)
|
||||
|
@ -84,8 +84,6 @@ module.exports = function createComponentBuilder() {
|
||||
|
||||
this.contentTypes.set(uid, contentType);
|
||||
|
||||
const defaultCollectionName = nameToCollectionName(infos.pluralName);
|
||||
|
||||
// support self referencing content type relation
|
||||
Object.keys(infos.attributes).forEach(key => {
|
||||
const { target } = infos.attributes[key];
|
||||
@ -97,16 +95,14 @@ module.exports = function createComponentBuilder() {
|
||||
contentType
|
||||
.setUID(uid)
|
||||
.set('kind', infos.kind || typeKinds.COLLECTION_TYPE)
|
||||
.set('collectionName', infos.collectionName || defaultCollectionName)
|
||||
.set('collectionName', nameToCollectionName(infos.pluralName))
|
||||
.set('info', {
|
||||
singularName: infos.singularName,
|
||||
pluralName: infos.pluralName,
|
||||
displayName: infos.displayName,
|
||||
description: infos.description,
|
||||
})
|
||||
.set('options', {
|
||||
draftAndPublish: infos.draftAndPublish || false,
|
||||
})
|
||||
.set('options', { draftAndPublish: infos.draftAndPublish || false })
|
||||
.set('pluginOptions', infos.pluginOptions)
|
||||
.setAttributes(this.convertAttributes(infos.attributes));
|
||||
|
||||
@ -213,7 +209,6 @@ module.exports = function createComponentBuilder() {
|
||||
});
|
||||
|
||||
contentType
|
||||
.set('collectionName', infos.collectionName)
|
||||
.set('kind', infos.kind || contentType.schema.kind)
|
||||
.set(['info', 'displayName'], infos.displayName)
|
||||
.set(['info', 'description'], infos.description)
|
||||
|
Loading…
x
Reference in New Issue
Block a user