Created
March 25, 2016 22:55
-
-
Save AbraaoAlves/f32713cdb81d8b0aff4a to your computer and use it in GitHub Desktop.
Programatic strict change data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Update Neighborhood Name | |
| router.put '/:id', (req, res) -> | |
| Neighborhoods = req.app.components.neighborhoods['neighborhoods.model'] | |
| params = { | |
| _id: req.params.id | |
| } | |
| Neighborhoods | |
| .update( | |
| params, | |
| req.body) | |
| .exec (err, data) -> | |
| console.log err || "." | |
| res.status(200).json(data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Update Neighborhood Name | |
| router.put '/:id', (req, res) -> | |
| Neighborhoods = req.app.components.neighborhoods['neighborhoods.model'] | |
| params = { | |
| _id: req.params.id | |
| } | |
| # REVIEW: Nesse caso só faz sentido atualizar o nome do bairro. O Id da Cidade, ou qualquer outra infomação deve se manter intacta | |
| Neighborhoods | |
| .update( | |
| params, | |
| {name} = req.body) | |
| .exec (err, data) -> | |
| console.log err || "." | |
| res.status(200).json(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment