Guest User

Untitled

a guest
Oct 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. updateProducts(productForm, id) {
  2. const temp = {
  3. 'description': productForm.description,
  4. 'quality': productForm.quality
  5. };
  6. return this.httpObj.put(`${this.uri}/products/${id}`, JSON.stringify(temp), {
  7. headers: new HttpHeaders({
  8. 'Content-Type': 'application/json'
  9. })
  10. });
  11. }
  12.  
  13. router.put('/:id', function(req, res, next) {
  14. Products.findByIdAndUpdate(req.params.id, req.body, function (err, post) {
  15. if (err) return next(err);
  16. res.json(post);
  17. });
  18. });
Add Comment
Please, Sign In to add comment