Skip to content

Commit

Permalink
Merge pull request #293 from Pinelab-studio/fix/vendure-order-client-…
Browse files Browse the repository at this point in the history
…updates

Vendure order client updates
  • Loading branch information
martijnvdbrug authored Nov 15, 2023
2 parents 1c4a087 + 2b31804 commit 0628f91
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
5 changes: 5 additions & 0 deletions packages/vendure-order-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.6.0 (2023-13-09)

- Make VendureOrderClient.updateEligibleShippingMethods public
- export the store helpers

# 2.5.0 (2023-13-09)

- Export vendure graphql types
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-order-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-order-client",
"version": "2.5.0",
"version": "2.6.0",
"description": "A tiny, framework agnostic client for managing active orders and checkout with Vendure.",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
1 change: 1 addition & 0 deletions packages/vendure-order-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './vendure-order-client';
export * from './vendure-order-events';
export * from './graphql-generated-types';
export * from './store-helpers';
22 changes: 11 additions & 11 deletions packages/vendure-order-client/src/vendure-order-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class VendureOrderClient<A = unknown> {
productVariantIds: [productVariantId],
quantity,
});
void this.updateEligibleShippingMehods();
void this.updateEligibleShippingMethods();
return activeOrder;
}

Expand Down Expand Up @@ -190,12 +190,12 @@ export class VendureOrderClient<A = unknown> {
quantity: -adjustment, // adjustment is negative, so invert it
});
}
void this.updateEligibleShippingMehods();
void this.updateEligibleShippingMethods();
return activeOrder;
}

async removeOrderLine(orderLineId: Id): Promise<ActiveOrder<A>> {
void this.updateEligibleShippingMehods();
void this.updateEligibleShippingMethods();
return await this.adjustOrderLine(orderLineId, 0);
}

Expand All @@ -218,7 +218,7 @@ export class VendureOrderClient<A = unknown> {
productVariantIds: allVariantIds,
quantity: totalQuantity,
});
void this.updateEligibleShippingMehods();
void this.updateEligibleShippingMethods();
return activeOrder;
}

Expand All @@ -235,7 +235,7 @@ export class VendureOrderClient<A = unknown> {
this.eventBus.emit('coupon-code-applied', {
couponCode,
});
void this.updateEligibleShippingMehods();
void this.updateEligibleShippingMethods();
return activeOrder;
}

Expand All @@ -257,7 +257,7 @@ export class VendureOrderClient<A = unknown> {
this.eventBus.emit('coupon-code-removed', {
couponCode,
});
void this.updateEligibleShippingMehods();
void this.updateEligibleShippingMethods();
return activeOrder;
}

Expand All @@ -273,7 +273,7 @@ export class VendureOrderClient<A = unknown> {
setCustomerForOrder as ActiveOrder<A>
);
setResult(this.$activeOrder, activeOrder);
void this.updateEligibleShippingMehods();
void this.updateEligibleShippingMethods();
return activeOrder;
}

Expand All @@ -289,7 +289,7 @@ export class VendureOrderClient<A = unknown> {
setOrderShippingAddress as ActiveOrder<A>
);
setResult(this.$activeOrder, activeOrder);
void this.updateEligibleShippingMehods();
void this.updateEligibleShippingMethods();
return activeOrder;
}

Expand All @@ -303,7 +303,7 @@ export class VendureOrderClient<A = unknown> {
setOrderBillingAddress as ActiveOrder<A>
);
setResult(this.$activeOrder, activeOrder);
void this.updateEligibleShippingMehods();
void this.updateEligibleShippingMethods();
return activeOrder;
}

Expand All @@ -319,7 +319,7 @@ export class VendureOrderClient<A = unknown> {
setOrderShippingMethod as ActiveOrder<A>
);
setResult(this.$activeOrder, activeOrder);
void this.updateEligibleShippingMehods();
void this.updateEligibleShippingMethods();
return activeOrder;
}

Expand Down Expand Up @@ -479,7 +479,7 @@ export class VendureOrderClient<A = unknown> {
}

@HandleLoadingState('$eligibleShippingMethods')
private async updateEligibleShippingMehods(): Promise<void> {
async updateEligibleShippingMethods(): Promise<void> {
const { eligibleShippingMethods } = await this.rawRequest<{
eligibleShippingMethods: ShippingMethodQuote[];
}>(this.queries.GET_ELIGIBLE_SHIPPING_METHODS);
Expand Down

0 comments on commit 0628f91

Please sign in to comment.