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(dashboard): bust order preview cache to reset fulfilled quantity #8687

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

riqwan
Copy link
Contributor

@riqwan riqwan commented Aug 21, 2024

what:

  • busts order cache to reset fulfilled quantity

RESOLVES CC-325

Copy link

changeset-bot bot commented Aug 21, 2024

⚠️ No Changeset found

Latest commit: 80a7a44

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

@riqwan riqwan marked this pull request as ready for review August 21, 2024 08:05
@riqwan riqwan requested a review from a team as a code owner August 21, 2024 08:05
Copy link

vercel bot commented Aug 21, 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 Aug 21, 2024 0:01am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Aug 21, 2024 0:01am
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2024 0:01am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2024 0:01am
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2024 0:01am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2024 0:01am
resources-docs ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2024 0:01am

@@ -35,7 +35,7 @@ export const useCancelFulfillment = (
onSuccess: (data: any, variables: any, context: any) => {
queryClient.invalidateQueries({ queryKey: fulfillmentsQueryKeys.lists() })
queryClient.invalidateQueries({
queryKey: ordersQueryKeys.details(),
queryKey: ordersQueryKeys.all,
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no need to invalidate everything on orders if we just want to refresh preview.
You can pass orderId as a param in the hook and call ordersQueryKeys.preview(id).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good push, I'll do this for all the other ones i've done so far as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fPolic just changed. Invalidating just the .detail(id) isn't invalidating it correctly though.

@riqwan riqwan force-pushed the fix/fulfilled-qty branch from d50ec90 to 684fe66 Compare August 21, 2024 11:58
@riqwan riqwan merged commit 0da9445 into develop Aug 21, 2024
23 checks passed
@riqwan riqwan deleted the fix/fulfilled-qty branch August 21, 2024 14:23
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