mirror of
https://github.com/strapi/strapi.git
synced 2025-08-21 07:09:31 +00:00
Lowercase attributes' names on API generated through the CLI
This commit is contained in:
parent
038c8ec29b
commit
f8cebb98f4
@ -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.
|
||||
|
@ -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
@ -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":""}
|
@ -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');
|
||||
|
||||
|
@ -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 => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user