Skip to content

Commit

Permalink
fix: checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
chase-moskal committed Aug 12, 2023
1 parent d93a643 commit 16e2bfc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions s/shopify/graphql/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function make_request_for_checkout_create({
variables: {
input: {
lineItems: (line_items
.filter(remove_items_with_zero_quantity)
.filter(quantity_is_greater_than_zero)
.map(i => ({
variantId: i.variant_id,
quantity: i.quantity
Expand All @@ -44,8 +44,8 @@ export function make_request_for_checkout_create({
}
}

function remove_items_with_zero_quantity(item: CheckoutLineItem) {
return item.quantity < 1
function quantity_is_greater_than_zero(item: CheckoutLineItem) {
return item.quantity > 0
}

export type GqlCheckout = {
Expand Down

0 comments on commit 16e2bfc

Please sign in to comment.