diff --git a/app/mirage/config.js b/app/mirage/config.js index 3982c0c..e39ccee 100644 --- a/app/mirage/config.js +++ b/app/mirage/config.js @@ -24,4 +24,19 @@ export function testConfig() { this.post('/characteristics'); this.get('/characteristics/:id'); this.put('/characteristics/:id'); + + this.get('/strains', function(db /*, request*/) { + return { + strains: db.strains, + species: db.species, + }; + }); + this.post('/strains'); + this.get('/strains/:id', function(db, request) { + return { + strain: db.strains.find(request.params.id), + species: db.species, // Just send back everything we've got + } + }); + this.put('/strains/:id'); } diff --git a/app/mirage/factories/strains.js b/app/mirage/factories/strains.js new file mode 100644 index 0000000..6165528 --- /dev/null +++ b/app/mirage/factories/strains.js @@ -0,0 +1,17 @@ +import Mirage, { faker } from 'ember-cli-mirage'; + +export default Mirage.Factory.extend({ + measurements: [], + characteristics: [], + species: 0, + strainName() { return faker.lorem.words().join(' '); }, + typeStrain: faker.random.boolean(), + accessionNumbers() { return faker.lorem.words().join(' '); }, + genbank() { return faker.lorem.words().join(' '); }, + wholeGenomeSequence() { return faker.lorem.words().join(' '); }, + isolatedFrom: faker.lorem.sentences(), + notes: faker.lorem.sentences(), + totalMeasurements: 0, + sortOrder: faker.random.number(), + canEdit: faker.random.boolean(), +}); diff --git a/app/pods/protected/strains/index/template.hbs b/app/pods/protected/strains/index/template.hbs index 077d22a..851f93b 100644 --- a/app/pods/protected/strains/index/template.hbs +++ b/app/pods/protected/strains/index/template.hbs @@ -1,5 +1,5 @@