Cleaning up new species a bit
This commit is contained in:
parent
b58e86a3fd
commit
886fda6843
9 changed files with 82 additions and 26 deletions
|
@ -80,7 +80,8 @@ module.exports = function(app) {
|
|||
});
|
||||
|
||||
speciesRouter.post('/', function(req, res) {
|
||||
res.status(201).end();
|
||||
req.body.species.id = Math.max.apply(Math, SPECIES.map(function(o){return o.id;})) + 1;
|
||||
res.status(201).send(req.body);
|
||||
});
|
||||
|
||||
speciesRouter.get('/:id', function(req, res) {
|
||||
|
@ -93,11 +94,7 @@ module.exports = function(app) {
|
|||
});
|
||||
|
||||
speciesRouter.put('/:id', function(req, res) {
|
||||
res.send({
|
||||
'species': {
|
||||
id: req.params.id
|
||||
}
|
||||
});
|
||||
res.send(req.body);
|
||||
});
|
||||
|
||||
speciesRouter.delete('/:id', function(req, res) {
|
||||
|
|
|
@ -92,7 +92,8 @@ module.exports = function(app) {
|
|||
});
|
||||
|
||||
strainsRouter.post('/', function(req, res) {
|
||||
res.status(201).end();
|
||||
req.body.strain.id = Math.max.apply(Math, STRAINS.map(function(o){return o.id;})) + 1;
|
||||
res.status(201).send(req.body);
|
||||
});
|
||||
|
||||
strainsRouter.get('/:id', function(req, res) {
|
||||
|
|
Reference in a new issue