Skip to content

Commit

Permalink
shipping info optional
Browse files Browse the repository at this point in the history
  • Loading branch information
erikrakuscek committed Mar 6, 2024
1 parent 59eb9ff commit 279d73e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/commerce/service/impls/standalone/orders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ const updateOrder = async (
email: string,
paymentMethod: string,
// TODO: add shippingInfo type
shippingInfo: any,
items: ActualLineItemSnapshot[],
options: {
dbName: string
ordersTable: string
}
},
shippingInfo?: any
): Promise<{
success: boolean,
error: any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class StandaloneService
}

// TODO: add shippingInfo type
async updateOrder(orderId: string, email: string, paymentMethod: string, shippingInfo: any): Promise<void> {
async updateOrder(orderId: string, email: string, paymentMethod: string, shippingInfo?: any): Promise<void> {
const snapshot = this.takeSnapshot()
updateOrderHelper(orderId, email, paymentMethod, shippingInfo, snapshot.items, this._options) // didn't want to have two levels of 'items'
updateOrderHelper(orderId, email, paymentMethod, snapshot.items, this._options, shippingInfo) // didn't want to have two levels of 'items'
}

takeSnapshot = (): StandaloneServiceSnapshot => ({
Expand Down
2 changes: 1 addition & 1 deletion packages/commerce/types/commerce-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface CommerceService extends ObsLineItemRef {

createOrder(email: string, paymentMethod: string): Promise<string | undefined>
// TODO: add shippingInfo type
updateOrder(orderId: string, email: string, paymentMethod: string, shippingInfo: any): Promise<void>
updateOrder(orderId: string, email: string, paymentMethod: string, shippingInfo?: any): Promise<void>

/**
* Sets the tokens at each level supplied.
Expand Down

0 comments on commit 279d73e

Please sign in to comment.