Skip to content

Commit

Permalink
Merge pull request #2526 from Shopify/vic/return-uuids-add-line-item
Browse files Browse the repository at this point in the history
Return UUIDs from addLineItem and addCustomSale
  • Loading branch information
vctrchu authored Dec 16, 2024
2 parents 936ac67 + 8732175 commit 9ce3684
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Refer to the [migration guide](/docs/api/pos-ui-extensions/migrating) for more i
- Added [PrintApi](/docs/api/pos-ui-extensions/apis/print-api) and a [PrintPreview](/docs/api/pos-ui-extensions/components/printpreview) component.
- Added \`currency\` prop to the [SessionApi](/docs/api/pos-ui-extensions/apis/session-api).
- [Cart API](/docs/api/pos-ui-extensions/apis/cart-api) updates:
- \`addLineItem\` and \`addCustomSale\` now return a UUID for the created item.
`,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,16 @@ export interface CartApiContent {

/** Add a custom sale to the cart
* @param customSale the custom sale object to add to the cart
* @returns {string} the uuid of the line item added
*/
addCustomSale(customSale: CustomSale): Promise<void>;
addCustomSale(customSale: CustomSale): Promise<string>;

/** Add a line item by variant ID to the cart
* @param variantId the product variant's numeric ID to add to the cart
* @param quantity the number of this variant to add to the cart
* @returns {string} the uuid of the line item added
*/
addLineItem(variantId: number, quantity: number): Promise<void>;
addLineItem(variantId: number, quantity: number): Promise<string>;

/** Remove the line item at this uuid from the cart
* @param uuid the uuid of the line item that should be removed
Expand Down

0 comments on commit 9ce3684

Please sign in to comment.