coalesceFindRequests
This commit is contained in:
parent
37becad20a
commit
6e7e04f225
3 changed files with 20 additions and 3 deletions
|
@ -3,5 +3,6 @@ import config from '../config/environment';
|
|||
|
||||
export default DS.RESTAdapter.reopen({
|
||||
namespace: 'api/hymenobacter',
|
||||
host: config.apiURL
|
||||
host: config.apiURL,
|
||||
coalesceFindRequests: true,
|
||||
});
|
||||
|
|
|
@ -146,8 +146,16 @@ module.exports = function(app) {
|
|||
]
|
||||
|
||||
measurementsRouter.get('/', function(req, res) {
|
||||
var measurements;
|
||||
if (req.query.ids) {
|
||||
measurements = MEASUREMENTS.filter(function(m) {
|
||||
return req.query.ids.indexOf(m.id.toString()) > -1;
|
||||
});
|
||||
} else {
|
||||
measurements = MEASUREMENTS;
|
||||
}
|
||||
res.send({
|
||||
'measurements': MEASUREMENTS
|
||||
'measurements': measurements
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -66,8 +66,16 @@ module.exports = function(app) {
|
|||
];
|
||||
|
||||
strainsRouter.get('/', function(req, res) {
|
||||
var strains;
|
||||
if (req.query.ids) {
|
||||
strains = STRAINS.filter(function(s) {
|
||||
return req.query.ids.indexOf(s.id.toString()) > -1;
|
||||
});
|
||||
} else {
|
||||
strains = STRAINS;
|
||||
}
|
||||
res.send({
|
||||
'strains': STRAINS
|
||||
'strains': strains
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Reference in a new issue