Lowercase attributes' names on API generated through the CLI

This commit is contained in:
Aurelsicoko 2017-10-11 12:08:04 +02:00
parent 038c8ec29b
commit f8cebb98f4
7 changed files with 11 additions and 9 deletions

View File

@ -83,15 +83,16 @@ module.exports = (scope, cb) => {
}
return {
name: _.trim(_.deburr(_.camelCase(parts[0]).toLowerCase())),
name: _.trim(_.deburr(_.lowerCase(parts[0]).toLowerCase())),
params: {
type: _.trim(_.deburr(_.camelCase(parts[1]).toLowerCase()))
type: _.trim(_.deburr(_.lowerCase(parts[1]).toLowerCase()))
}
};
} else {
return _.has(attribute, 'params.type') ? attribute : undefined;
}
});
scope.attributes = _.compact(scope.attributes);
// Handle invalid action arguments.

View File

@ -1,13 +1,16 @@
{
"connection": "<%= connection %>",
"description": "<%= description %>",
"collectionName": "<%= collectionName || idPluralized %>",
"info": {
"name": "<%= id %>",
"description": "<%= description %>"
},
"options": {
"increments": true,
"timestamps": true,
"comment": ""
},
"attributes": {
<%= attributes %>
<%= attributes %>
}
}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"version":3,"file":"vendor.dll.js","sources":["webpack:///vendor.dll.js"],"mappings":"AAAA;;;;;AA4PA;;;;;;;;;;;;;;AA8lIA","sourceRoot":""}
{"version":3,"file":"vendor.dll.js","sources":["webpack:///vendor.dll.js"],"mappings":"AAAA;;;;;AAwPA;;;;;;;;;;;;;;AAslIA","sourceRoot":""}

View File

@ -3,7 +3,6 @@
const fs = require('fs');
const path = require('path');
const _ = require('lodash');
const send = require('koa-send');
const Service = require('../services/ContentTypeBuilder');

View File

@ -3,7 +3,6 @@
const path = require('path');
const fs = require('fs');
const _ = require('lodash');
const send = require('koa-send');
module.exports = {
menu: async ctx => {