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

feat(medusa, medusa-js, medusa-react): Add store queries to react medusa #3436

Merged
merged 4 commits into from
Mar 10, 2023

Conversation

riqwan
Copy link
Contributor

@riqwan riqwan commented Mar 9, 2023

What:

  • Adds queries to medusa react for core
  • Fix naming issues in types

RESOLVES CORE-1131

@changeset-bot
Copy link

changeset-bot bot commented Mar 9, 2023

🦋 Changeset detected

Latest commit: ae90f80

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

This PR includes changesets to release 4 packages
Name Type
medusa-react Patch
@medusajs/medusa-js Patch
@medusajs/medusa Patch
@medusajs/inventory 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

@vercel
Copy link

vercel bot commented Mar 9, 2023

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

1 Ignored Deployment
Name Status Preview Comments Updated
medusa-docs ⬜️ Ignored (Inspect) Mar 10, 2023 at 9:47AM (UTC)

@riqwan riqwan changed the title chore: Add store queries to react medusa feat(medusa, medusa-js, medusa-react): Add store queries to react medusa Mar 9, 2023
@riqwan riqwan marked this pull request as ready for review March 9, 2023 16:36
@riqwan riqwan requested a review from a team as a code owner March 9, 2023 16:36
Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

A couple of questions and todos 💪

const { client } = useMedusa()
const { data, ...rest } = useQuery(
storeProductCategoryKeys.detail(id),
() => client.store.productCategories.retrieve(id, query),
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Shouldn't this be client.productCategories.retrieve

const { client } = useMedusa()
const { data, ...rest } = useQuery(
storeProductCategoryKeys.list(query),
() => client.store.productCategories.list(query),
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Shouldn't this be client.productCategories.list?

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@fPolic fPolic left a comment

Choose a reason for hiding this comment

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

LGTM!

@kodiakhq kodiakhq bot merged commit 9ba09ba into develop Mar 10, 2023
@kodiakhq kodiakhq bot deleted the feat/store-queries branch March 10, 2023 10:14
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.

3 participants