Fixes #4991 - Now selects basal profile based day by day (#5572)

* Test profile settings

* NPM Version change

* Use console log

* Use console log for client

* Use console log for client.sbx

* Use console log for client.ddata

* Use console log for client again

* revert

* Added multi-profile reporting capabilities

Co-authored-by: VIS TFS Admin <liveid@visualsolution.co.uk>
This commit is contained in:
fromorbonia
2020-06-12 17:47:28 +03:00
committed by GitHub
co-authored by VIS TFS Admin
parent 500de79b5d
commit 802d98684f
8 changed files with 405 additions and 43 deletions
+25
View File
@@ -16,6 +16,31 @@ function configure (app, wares, ctx) {
api.use(wares.bodyParser.urlencoded({ extended: true }));
api.use(ctx.authorization.isPermitted('api:profile:read'));
/**
* @function query_models
* Perform the standard query logic, translating API parameters into mongo
* db queries in a fairly regimented manner.
* This middleware executes the query, returning the results as JSON
*/
function query_models (req, res, next) {
var query = req.query;
// If "?count=" is present, use that number to decide how many to return.
if (!query.count) {
query.count = consts.ENTRIES_DEFAULT_COUNT;
}
// perform the query
ctx.profile.list_query(query, function payload(err, profiles) {
return res.json(profiles);
});
}
// List profiles available
api.get('/profiles/', query_models);
// List profiles available
api.get('/profile/', function(req, res) {
ctx.profile.list(function (err, attribute) {