Implement multiple layer date wrapping
This commit is contained in:
parent
7df1a19da4
commit
9ee6d7fc91
@ -28,12 +28,17 @@ class VectorMapConfigAdapter {
|
||||
}
|
||||
|
||||
_wrapDates(requestMapConfig, user) {
|
||||
const originalQuery = requestMapConfig.layers[0].options.sql;
|
||||
return Promise.all(requestMapConfig.layers.map(layer => this._wrapLayer(layer, user)))
|
||||
.then(() => requestMapConfig);
|
||||
}
|
||||
|
||||
_wrapLayer(layer, user) {
|
||||
const originalQuery = layer.options.sql;
|
||||
return this._getColumns(user, originalQuery)
|
||||
.then(result => {
|
||||
const newSqlQuery = dateWrapper.wrapDates(originalQuery, result.fields);
|
||||
requestMapConfig.layers[0].options.sql = newSqlQuery;
|
||||
return requestMapConfig;
|
||||
layer.options.sql = newSqlQuery;
|
||||
return layer;
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user