mirror of
https://github.com/strapi/strapi.git
synced 2025-12-29 08:04:51 +00:00
Update branch
Merge branch 'plugin/content-type-builder-dev' of https://github.com/strapi/strapi into plugin/content-type-builder-dev
This commit is contained in:
commit
e29cbfdab2
@ -205,8 +205,6 @@ module.exports = function (strapi) {
|
||||
_.forEach(definition.attributes, (details, name) => {
|
||||
const verbose = _.get(utilsModels.getNature(details, name), 'verbose') || '';
|
||||
|
||||
console.log("coucou", details, name);
|
||||
|
||||
// Build associations key
|
||||
if (!_.isEmpty(verbose)) {
|
||||
utilsModels.defineAssociations(globalName, definition, details, name);
|
||||
|
||||
@ -25,7 +25,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
createModel: async ctx => {
|
||||
const { name, description, connection, collectionName, attributes = [] } = JSON.parse(ctx.request.body);
|
||||
const { name, description, connection, collectionName, attributes = [] } = ctx.request.body;
|
||||
|
||||
if (!name) return ctx.badRequest(null, [{ messages: [{ id: 'request.error.name.missing' }] }]);
|
||||
if (!_.includes(Service.getConnections(), connection)) return ctx.badRequest(null, [{ messages: [{ id: 'request.error.connection.unknow' }] }]);
|
||||
@ -81,7 +81,7 @@ module.exports = {
|
||||
|
||||
updateModel: async ctx => {
|
||||
const { model } = ctx.params;
|
||||
const { name, description, connection, collectionName, attributes = [] } = JSON.parse(ctx.request.body);
|
||||
const { name, description, connection, collectionName, attributes = [] } = ctx.request.body;
|
||||
|
||||
if (!name) return ctx.badRequest(null, [{ messages: [{ id: 'request.error.name.missing' }] }]);
|
||||
if (!_.includes(Service.getConnections(), connection)) return ctx.badRequest(null, [{ messages: [{ id: 'request.error.connection.unknow' }] }]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user