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-react): invalidate products query on category delete #3485

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

riqwan
Copy link
Contributor

@riqwan riqwan commented Mar 15, 2023

What:

  • invalidates product queries on category delete

FIXES CORE-1251

@changeset-bot
Copy link

changeset-bot bot commented Mar 15, 2023

🦋 Changeset detected

Latest commit: 1df7d3a

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

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

@vercel
Copy link

vercel bot commented Mar 15, 2023

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

Name Status Preview Comments Updated
medusa-docs ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 15, 2023 at 5:27PM (UTC)

@riqwan riqwan force-pushed the fix/invalidate-products-query branch from 4fecc32 to d1b2a18 Compare March 15, 2023 15:41
@riqwan riqwan marked this pull request as ready for review March 15, 2023 15:42
@riqwan riqwan requested a review from a team as a code owner March 15, 2023 15:42
Copy link
Contributor

@kasperkristensen kasperkristensen left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -50,6 +49,8 @@ function ProductCategoryListItemDetails(
onClick: async () => {
try {
await deleteCategory()
await queryClient.invalidateQueries(adminProductKeys.all)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we do this in the useAdminDeleteProductCategory hook similar to what we do with useAdminUpdateProductCategory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done @fPolic, thanks!

@riqwan riqwan force-pushed the fix/invalidate-products-query branch from d1b2a18 to 1df7d3a Compare March 15, 2023 17:23
@riqwan riqwan changed the title fix(admin-ui): invalidate products query on category delete fix(medusa-react): invalidate products query on category delete Mar 15, 2023
@olivermrbl olivermrbl merged commit 4ede919 into develop Mar 15, 2023
@olivermrbl olivermrbl deleted the fix/invalidate-products-query branch March 15, 2023 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants