mirror of
https://github.com/strapi/strapi.git
synced 2025-08-20 22:59:11 +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 {
|
return {
|
||||||
name: _.trim(_.deburr(_.camelCase(parts[0]).toLowerCase())),
|
name: _.trim(_.deburr(_.lowerCase(parts[0]).toLowerCase())),
|
||||||
params: {
|
params: {
|
||||||
type: _.trim(_.deburr(_.camelCase(parts[1]).toLowerCase()))
|
type: _.trim(_.deburr(_.lowerCase(parts[1]).toLowerCase()))
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return _.has(attribute, 'params.type') ? attribute : undefined;
|
return _.has(attribute, 'params.type') ? attribute : undefined;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
scope.attributes = _.compact(scope.attributes);
|
scope.attributes = _.compact(scope.attributes);
|
||||||
|
|
||||||
// Handle invalid action arguments.
|
// Handle invalid action arguments.
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
{
|
{
|
||||||
"connection": "<%= connection %>",
|
"connection": "<%= connection %>",
|
||||||
"description": "<%= description %>",
|
|
||||||
"collectionName": "<%= collectionName || idPluralized %>",
|
"collectionName": "<%= collectionName || idPluralized %>",
|
||||||
|
"info": {
|
||||||
|
"name": "<%= id %>",
|
||||||
|
"description": "<%= description %>"
|
||||||
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"increments": true,
|
"increments": true,
|
||||||
"timestamps": true,
|
"timestamps": true,
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
"attributes": {
|
"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 fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const send = require('koa-send');
|
|
||||||
|
|
||||||
const Service = require('../services/ContentTypeBuilder');
|
const Service = require('../services/ContentTypeBuilder');
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const send = require('koa-send');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
menu: async ctx => {
|
menu: async ctx => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user