Skip to content

Commit

Permalink
[Chore] Firestore 유저 장바구니 데이터에 접근하는 코드 수정#4
Browse files Browse the repository at this point in the history
  • Loading branch information
jekyun-park committed Jan 4, 2023
1 parent de3faca commit 5517817
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ class OrderItemStore: ObservableObject {
let newOptions: [String: String] = changeOptionsLocalToServer(item.option)

// Document의 id(name)는 상품의 id여야 한다.
firebasePath.document(uid).collection("MyCart").document(item.itemuid).setData([
"itemuid": item.itemuid,
"storeId": item.storeId,
"itemName": item.itemName,
"itemImage": item.itemImage,
"price": item.price,
"amount": item.amount,
"deliveryStatus": item.deliveryStatus.rawValue,
"option": newOptions
])
firebasePath.collection("CustomerInfo")
.document(uid).collection("myCart").addDocument(data: [
"itemuid": item.itemuid,
"storeId": item.storeId,
"itemName": item.itemName,
"itemImage": item.itemImage,
"price": item.price,
"amount": item.amount,
"deliveryStatus": item.deliveryStatus.rawValue,
"option": newOptions
])
}

// MARK: - Request ShoppingBag Items
Expand Down

0 comments on commit 5517817

Please sign in to comment.