Do not use 'step'

This commit is contained in:
Daniel García Aubert 2018-05-30 17:00:15 +02:00
parent 12b91e7671
commit 3820894454

View File

@ -33,28 +33,22 @@ function CreateLayergroupMapConfigProvider(
module.exports = CreateLayergroupMapConfigProvider;
CreateLayergroupMapConfigProvider.prototype.getMapConfig = function(callback) {
var self = this;
if (this.mapConfig && this.params && this.context) {
return callback(null, this.mapConfig, this.params, this.context);
}
var context = {};
step(
function prepareContextLimits() {
self.userLimitsBackend.getRenderLimits(self.user, self.params.api_key, this);
},
function handleRenderLimits(err, renderLimits) {
assert.ifError(err);
context.limits = renderLimits;
self.context = context;
return null;
},
function finish(err) {
return callback(err, self.mapConfig, self.params, context);
this.userLimitsBackend.getRenderLimits(this.user, this.params.api_key, (err, renderLimits) => {
if (err) {
return callback(err);
}
);
context.limits = renderLimits;
this.context = context;
return callback(err, this.mapConfig, this.params, context);
});
};
CreateLayergroupMapConfigProvider.prototype.getKey = MapStoreMapConfigProvider.prototype.getKey;