Add functional version of the middleware that changes the default query based on request body
- The middleware is on src/middlewares/reqBody.js
- It has the methods parse and add_metrics
- The method parse processes the body of the HTTP request and calls a method based on its mode. Currently, it only supports the mode add_metrics
- If the mode is add_metrics, it calls the method add_metrics for each column and its specified operations
- The method add_metrics adds a field to req.sql for each operation specified to the column and sets the flag req.hasMetrics to true, so that the route knows that it should not create its default query
Merge request reports
Activity
requested review from @hvehrenfried
mentioned in commit e7105c07
Please register or sign in to reply