mirror of
https://github.com/strapi/strapi.git
synced 2025-10-11 08:02:55 +00:00
Add uids to models
This commit is contained in:
parent
b58d7a138a
commit
7b28777825
3
packages/strapi/lib/core/bootstrap.js
vendored
3
packages/strapi/lib/core/bootstrap.js
vendored
@ -64,6 +64,7 @@ module.exports = function(strapi) {
|
|||||||
|
|
||||||
Object.assign(model, {
|
Object.assign(model, {
|
||||||
modelType: 'contentType',
|
modelType: 'contentType',
|
||||||
|
uid: `app::${key}.${index}`,
|
||||||
apiName: key,
|
apiName: key,
|
||||||
globalId: model.globalId || _.upperFirst(_.camelCase(index)),
|
globalId: model.globalId || _.upperFirst(_.camelCase(index)),
|
||||||
collectionName: model.collectionName || `${index}`.toLocaleLowerCase(),
|
collectionName: model.collectionName || `${index}`.toLocaleLowerCase(),
|
||||||
@ -131,6 +132,7 @@ module.exports = function(strapi) {
|
|||||||
|
|
||||||
Object.assign(model, {
|
Object.assign(model, {
|
||||||
modelType: 'contentType',
|
modelType: 'contentType',
|
||||||
|
uid: `strapi::admin.${key}`,
|
||||||
identity: model.identity || _.upperFirst(key),
|
identity: model.identity || _.upperFirst(key),
|
||||||
globalId: model.globalId || _.upperFirst(_.camelCase(`admin-${key}`)),
|
globalId: model.globalId || _.upperFirst(_.camelCase(`admin-${key}`)),
|
||||||
connection:
|
connection:
|
||||||
@ -160,6 +162,7 @@ module.exports = function(strapi) {
|
|||||||
|
|
||||||
Object.assign(model, {
|
Object.assign(model, {
|
||||||
modelType: 'contentType',
|
modelType: 'contentType',
|
||||||
|
uid: `plugins::${pluginName}.${key}`,
|
||||||
plugin: pluginName,
|
plugin: pluginName,
|
||||||
collectionName:
|
collectionName:
|
||||||
model.collectionName || `${pluginName}_${key}`.toLowerCase(),
|
model.collectionName || `${pluginName}_${key}`.toLowerCase(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user