Beispiel #1
0
//call  updateById() function from the treaser service
function updateById(req, res) {
  dataService.updateById(req.params.id, req.body)
    .then(function () {
        res.status(200).send("Doc updated successfully");
    }) 
    .catch(function (err) {
        console.log(err);
        res.status(500).send(err);
    });
}
Beispiel #2
0
HomesAPI.put('/:home_id', function(req, res){
	Homes.updateById(req.params.home_id, req.body.home)
		.then(Help.sendStatus(res, 200))
		.catch(Help.sendStatusAndError(res, 500, 'Server error updating home by id'));
});