Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit 33167c5

Browse files
author
Steph Dietz
committed
add product id to cart item
1 parent 321c122 commit 33167c5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

backend/functions/assembly/crud.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ export function getCart(cartId: string): Cart {
366366
cartId + "_" + cartItems[i],
367367
);
368368
const product = getProduct(cartItems[i]);
369-
const cartItemObject = new CartItemObject(product, parseFloat(quantity));
369+
const cartItemObject = new CartItemObject(product, parseFloat(quantity), i);
370370
items.push(cartItemObject);
371371
}
372372
return new Cart(cartId, items);

backend/functions/assembly/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export class CartItemObject {
5050
constructor(
5151
public Product: Product,
5252
public quantity: f64,
53+
public cartId: f64,
5354
) {}
5455
}
5556

0 commit comments

Comments
 (0)