Skip to content

Commit

Permalink
feat: #56 (api) transitionOrderToState fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Baroshem committed Aug 22, 2021
1 parent 97eecc4 commit f9d76f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/api-client/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export { default as updateAddressDetails } from './updateAddressDetails';
export { default as getShippingMethods } from './getShippingMethods';
export { default as setShippingMethod } from './setShippingMethod';
export { default as setPaymentMethod } from './setPaymentMethod';
export { default as transitionOrderToState } from './transitionOrderToState';
8 changes: 7 additions & 1 deletion packages/composables/src/composables/useBilling/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ const params: UseBillingParams<OrderAddress, AddParams> = {
// OrderAddress has one property optional which is required in CreateAddressInput.
const response = await context.$vendure.api.updateAddressDetails({ input: billingDetails as CreateAddressInput, type: BILLING_TYPE }, customQuery);

return (response?.data?.setOrderBillingAddress as Order)?.billingAddress;
const newOrder = (response?.data?.setOrderBillingAddress as Order)?.billingAddress

if (newOrder) {
await context.$vendure.api.transitionOrderToState({ state: 'ArrangingPayment' });
}

return newOrder;
}
};

Expand Down

0 comments on commit f9d76f8

Please sign in to comment.