Remove step from catalog middleware
This commit is contained in:
parent
804c6645fa
commit
c1f2b96bfc
@ -28,26 +28,21 @@ AnalysesController.prototype.register = function(app) {
|
||||
AnalysesController.prototype.catalog = function () {
|
||||
return function catalogMiddleware(req, res, next) {
|
||||
const { user } = res.locals;
|
||||
const pg = new PSQL(dbParamsFromReqParams(res.locals));
|
||||
|
||||
step(
|
||||
function catalogQuery() {
|
||||
var pg = new PSQL(dbParamsFromReqParams(res.locals));
|
||||
getMetadata(user, pg, this);
|
||||
},
|
||||
function prepareResponse(err, catalogWithTables) {
|
||||
if (err) {
|
||||
if (err.message.match(/permission\sdenied/)) {
|
||||
err = new Error('Unauthorized');
|
||||
err.http_status = 401;
|
||||
}
|
||||
|
||||
return next(err);
|
||||
getMetadata(user, pg, (err, catalogWithTables) => {
|
||||
if (err) {
|
||||
if (err.message.match(/permission\sdenied/)) {
|
||||
err = new Error('Unauthorized');
|
||||
err.http_status = 401;
|
||||
}
|
||||
|
||||
res.locals.catalogWithTables = catalogWithTables;
|
||||
next();
|
||||
return next(err);
|
||||
}
|
||||
);
|
||||
|
||||
res.locals.catalogWithTables = catalogWithTables;
|
||||
next();
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user