Improve naming

This commit is contained in:
Daniel García Aubert
2018-03-13 13:21:40 +01:00
parent 0de272b195
commit 24b76208ac
+10 -10
View File
@@ -28,7 +28,7 @@ NamedMapsAdminController.prototype.register = function (app) {
credentialsMiddleware(),
checkContentType('POST', 'POST TEMPLATE'),
authorizedByAPIKey(this.authApi, 'create', 'POST TEMPLATE'),
create(this.templateMaps)
createTemplate(this.templateMaps)
);
app.put(
@@ -39,7 +39,7 @@ NamedMapsAdminController.prototype.register = function (app) {
credentialsMiddleware(),
checkContentType('PUT', 'PUT TEMPLATE'),
authorizedByAPIKey(this.authApi, 'update', 'PUT TEMPLATE'),
update(this.templateMaps)
updateTemplate(this.templateMaps)
);
app.get(
@@ -49,7 +49,7 @@ NamedMapsAdminController.prototype.register = function (app) {
localsMiddleware(),
credentialsMiddleware(),
authorizedByAPIKey(this.authApi, 'get', 'GET TEMPLATE'),
retrieve(this.templateMaps)
retrieveTemplate(this.templateMaps)
);
app.delete(
@@ -59,7 +59,7 @@ NamedMapsAdminController.prototype.register = function (app) {
localsMiddleware(),
credentialsMiddleware(),
authorizedByAPIKey(this.authApi, 'delete', 'DELETE TEMPLATE'),
destroy(this.templateMaps)
destroyTemplate(this.templateMaps)
);
app.get(
@@ -69,7 +69,7 @@ NamedMapsAdminController.prototype.register = function (app) {
localsMiddleware(),
credentialsMiddleware(),
authorizedByAPIKey(this.authApi, 'list', 'GET TEMPLATE LIST'),
list(this.templateMaps)
listTemplates(this.templateMaps)
);
app.options(
@@ -110,7 +110,7 @@ function authorizedByAPIKey (authApi, action, label) {
};
}
function create (templateMaps) {
function createTemplate (templateMaps) {
return function createTemplateMiddleware (req, res, next) {
const { user } = res.locals;
const template = req.body;
@@ -128,7 +128,7 @@ function create (templateMaps) {
};
}
function update (templateMaps) {
function updateTemplate (templateMaps) {
return function updateTemplateMiddleware (req, res, next) {
const { user } = res.locals;
const template = req.body;
@@ -147,7 +147,7 @@ function update (templateMaps) {
};
}
function retrieve (templateMaps) {
function retrieveTemplate (templateMaps) {
return function retrieveTemplateMiddleware (req, res, next) {
req.profiler.start('windshaft-cartodb.get_template');
@@ -176,7 +176,7 @@ function retrieve (templateMaps) {
};
}
function destroy (templateMaps) {
function destroyTemplate (templateMaps) {
return function destroyTemplateMiddleware (req, res, next) {
req.profiler.start('windshaft-cartodb.delete_template');
@@ -196,7 +196,7 @@ function destroy (templateMaps) {
};
}
function list (templateMaps) {
function listTemplates (templateMaps) {
return function listTemplatesMiddleware (req, res, next) {
req.profiler.start('windshaft-cartodb.get_template_list');