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:
cyril lopez 2017-08-17 09:19:07 +02:00
commit e29cbfdab2
2 changed files with 2 additions and 4 deletions

View File

@ -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);

View File

@ -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' }] }]);