Skip to content

Commit

Permalink
Add product id in cart for redirect on click
Browse files Browse the repository at this point in the history
  • Loading branch information
aojiaotage committed Aug 26, 2019
1 parent fb4c270 commit c259668
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/model/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ module.exports = app => {
nums: {
type: INTEGER,
},
product_id: {
type: UUID,
},
});

Model.createNewItem = async item => {
Expand Down
1 change: 1 addition & 0 deletions app/service/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Cart extends Service {
item.img_url = goods.img_url;
item.price = goods.price;
item.name = goods.name;
item.product_id = goods.product_id;
const created = await this.app.model.Cart.createNewItem(item);
// await this.app.model.userService.addUserService(item);
return created;
Expand Down

0 comments on commit c259668

Please sign in to comment.