Do not use locals middleware in named maps admin controller

This commit is contained in:
Daniel García Aubert 2018-03-23 16:16:53 +01:00
parent 516b1f765e
commit f7a23c094c

View File

@ -1,7 +1,6 @@
const { templateName } = require('../backends/template_maps'); const { templateName } = require('../backends/template_maps');
const cors = require('../middleware/cors'); const cors = require('../middleware/cors');
const user = require('../middleware/user'); const user = require('../middleware/user');
const locals = require('../middleware/locals');
const credentials = require('../middleware/credentials'); const credentials = require('../middleware/credentials');
const rateLimit = require('../middleware/rate-limit'); const rateLimit = require('../middleware/rate-limit');
const { RATE_LIMIT_ENDPOINTS_GROUPS } = rateLimit; const { RATE_LIMIT_ENDPOINTS_GROUPS } = rateLimit;
@ -27,7 +26,6 @@ NamedMapsAdminController.prototype.register = function (app) {
app.post( app.post(
`${templateBasePath}/`, `${templateBasePath}/`,
cors(), cors(),
locals(),
user(), user(),
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_CREATE), rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_CREATE),
credentials(), credentials(),
@ -40,7 +38,6 @@ NamedMapsAdminController.prototype.register = function (app) {
app.put( app.put(
`${templateBasePath}/:template_id`, `${templateBasePath}/:template_id`,
cors(), cors(),
locals(),
user(), user(),
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_UPDATE), rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_UPDATE),
credentials(), credentials(),
@ -53,7 +50,6 @@ NamedMapsAdminController.prototype.register = function (app) {
app.get( app.get(
`${templateBasePath}/:template_id`, `${templateBasePath}/:template_id`,
cors(), cors(),
locals(),
user(), user(),
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_GET), rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_GET),
credentials(), credentials(),
@ -65,7 +61,6 @@ NamedMapsAdminController.prototype.register = function (app) {
app.delete( app.delete(
`${templateBasePath}/:template_id`, `${templateBasePath}/:template_id`,
cors(), cors(),
locals(),
user(), user(),
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_DELETE), rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_DELETE),
credentials(), credentials(),
@ -77,7 +72,6 @@ NamedMapsAdminController.prototype.register = function (app) {
app.get( app.get(
`${templateBasePath}/`, `${templateBasePath}/`,
cors(), cors(),
locals(),
user(), user(),
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_LIST), rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_LIST),
credentials(), credentials(),