-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: allow addresses to be AddressPayload or string on DraftOrder creation #1902
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
I believe we should also allow you to pass address ids as payload when updating a draft order since we call CartService.update
i.e. the payload to update-draft-order.ts
should be:
@IsOptional()
@IsType([AddressPayload, String])
billing_address?: AddressPayload | string
@IsOptional()
@IsType([AddressPayload, String])
shipping_address?: AddressPayload | string
What do you think?
packages/medusa/src/api/routes/admin/draft-orders/create-draft-order.ts
Outdated
Show resolved
Hide resolved
Can I get you to merge in latest from |
LGTM! Pending @olivermrbl for final approval 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
What
shipping_address
andbilling_address
be either anAddressPayload
orstring
as part of the create draft order endpoint props.How
Why
The endpoint was using an old pattern for switching between addresses being either ids or payloads, which resulted in
billing_address
not being added during the creation process if it was not passed as an id.Also
Closes CORE-720