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

Commit 01cf0d6

Browse files
author
Steph Dietz
committed
add cart item ID to cart item object
1 parent 33167c5 commit 01cf0d6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

backend/functions/assembly/crud.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,11 @@ 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), i);
369+
const cartItemObject = new CartItemObject(
370+
product,
371+
parseFloat(quantity),
372+
cartItems[i],
373+
);
370374
items.push(cartItemObject);
371375
}
372376
return new Cart(cartId, items);

backend/functions/assembly/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class CartItemObject {
5050
constructor(
5151
public Product: Product,
5252
public quantity: f64,
53-
public cartId: f64,
53+
public cartItemId: string,
5454
) {}
5555
}
5656

0 commit comments

Comments
 (0)