Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- updateProducts(productForm, id) {
- const temp = {
- 'description': productForm.description,
- 'quality': productForm.quality
- };
- return this.httpObj.put(`${this.uri}/products/${id}`, JSON.stringify(temp), {
- headers: new HttpHeaders({
- 'Content-Type': 'application/json'
- })
- });
- }
- router.put('/:id', function(req, res, next) {
- Products.findByIdAndUpdate(req.params.id, req.body, function (err, post) {
- if (err) return next(err);
- res.json(post);
- });
- });
Add Comment
Please, Sign In to add comment