Skip to content
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(medusa): Delete ProductOption on Product without Variants #1846

Merged
merged 14 commits into from
Aug 29, 2022

Conversation

olivermrbl
Copy link
Contributor

@olivermrbl olivermrbl commented Jul 14, 2022

What
Solves admin issue 166

Deleting a product option on a product without variants currently throws, because we are cleaning up variant options as well.

How
Only do variant clean up, if product has variants

@olivermrbl olivermrbl requested a review from a team as a code owner July 14, 2022 13:50
@changeset-bot
Copy link

changeset-bot bot commented Jul 14, 2022

🦋 Changeset detected

Latest commit: 9621a05

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@medusajs/medusa Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@olivermrbl olivermrbl changed the title fix: Delete product option on product without variants fix(medusa): Delete product option on product without variants Jul 14, 2022
@olivermrbl olivermrbl changed the title fix(medusa): Delete product option on product without variants fix(medusa): Delete ProductOption on Product without Variants Jul 14, 2022
Copy link
Collaborator

@srindom srindom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small fixes here :)

.changeset/twelve-pots-kneel.md Outdated Show resolved Hide resolved
integration-tests/api/factories/simple-product-factory.ts Outdated Show resolved Hide resolved
packages/medusa/src/services/product.ts Outdated Show resolved Hide resolved
@olivermrbl olivermrbl requested a review from srindom July 18, 2022 14:04
Copy link
Collaborator

@srindom srindom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - one thing that we should consider, though, is whether it ever makes sense to have a product with no variants; i.e. this delete is already in an invalid_state.

@kodiakhq kodiakhq bot merged commit d14a039 into develop Aug 29, 2022
@kodiakhq kodiakhq bot deleted the fix/delete-product-option branch August 29, 2022 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants