Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- like(context) {
- const { productId } = context.params;
- models.products
- .get(productId)
- .then((response) => {
- const product = docModifier(response);
- product.likes = +product.likes + 1;
- models.products.put(productId, product).then((response) => {
- context.redirect(`#/products/details/${productId}`);
- });
- })
- .catch((error) => console.error(error));
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement