Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
intercept(context, next) {
const req = context.switchToHttp().getRequest();
const controller = context.getClass();
const options = reflection_helper_1.R.getCrudOptions(controller);
const parsed = request_query_parser_1.RequestQueryParser.create()
.parseParams(req.params, options.params)
.parseQuery(req.query)
.getParsed();
const crudReq = {
parsed,
options: {
query: options.query,
routes: options.routes,
params: options.params,
},
};
req[constants_1.PARSED_CRUD_REQUEST_KEY] = crudReq;
return next.handle();
}
};