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: validate regions exist for shipping option price update #9364

Merged
merged 3 commits into from
Sep 29, 2024

Conversation

srindom
Copy link
Collaborator

@srindom srindom commented Sep 28, 2024

What

  • Adds a step to updateShippingOptionsWorkflow and createShippingOptionsWorkflow that validates if the region prices being updated have corresponding regions configured.

Why

  • Previously, if you tried to send a region price update for a region that had been deleted the backend would throw an error when attempting to insert the region price. The error comes from a not-null constraint in the db, but it is better to validate that the regions we are trying to create prices for exist.

Fixes CC-542

Copy link

vercel bot commented Sep 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 29, 2024 9:38am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Sep 29, 2024 9:38am
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Sep 29, 2024 9:38am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Sep 29, 2024 9:38am
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Sep 29, 2024 9:38am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Sep 29, 2024 9:38am
resources-docs ⬜️ Ignored (Inspect) Visit Preview Sep 29, 2024 9:38am

Copy link

changeset-bot bot commented Sep 28, 2024

⚠️ No Changeset found

Latest commit: 9d29290

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@srindom srindom marked this pull request as ready for review September 28, 2024 16:18
@srindom srindom requested a review from a team as a code owner September 28, 2024 16:18
ContainerRegistrationKeys.REMOTE_QUERY
)

let remoteQueryObject = remoteQueryObjectFromString({
Copy link
Member

Choose a reason for hiding this comment

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

Q: nothing to do but should we start using the query graph api instead when writing new things?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes happy to do that - do you have an example implementation somewhere that I can reference

Copy link
Member

Choose a reason for hiding this comment

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

#9061
Should give some examples to look at. Let me know how it goes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will probably merge this for now - still happy to do a separate PR with the graph api to try it out though if you can share an example :)

@kodiakhq kodiakhq bot merged commit 0efbcd2 into develop Sep 29, 2024
23 checks passed
@kodiakhq kodiakhq bot deleted the fix/validate-shipping-option-prices branch September 29, 2024 09:52
panalgin pushed a commit to vennyx-org/medusa that referenced this pull request Oct 7, 2024
…s#9364)

**What**
- Adds a step to `updateShippingOptionsWorkflow` and `createShippingOptionsWorkflow` that validates if the region prices being updated have corresponding regions configured.

**Why**
- Previously, if you tried to send a region price update for a region that had been deleted the backend would throw an error when attempting to insert the region price. The error comes from a not-null constraint in the db, but it is better to validate that the regions we are trying to create prices for exist. 

Fixes CC-542
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.

2 participants