diff --git a/app/adapters/application.js b/app/adapters/application.js index 70db61e..3653149 100644 --- a/app/adapters/application.js +++ b/app/adapters/application.js @@ -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, }); diff --git a/server/mocks/measurements.js b/server/mocks/measurements.js index e48e35b..bf62b51 100644 --- a/server/mocks/measurements.js +++ b/server/mocks/measurements.js @@ -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 }); }); diff --git a/server/mocks/strains.js b/server/mocks/strains.js index 5c59054..b96191e 100644 --- a/server/mocks/strains.js +++ b/server/mocks/strains.js @@ -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 }); });