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: allow to pass search criteria to loadNavigationElements of useNavigation #1540

Conversation

kasztof
Copy link
Contributor

@kasztof kasztof commented Dec 18, 2024

Description

This closes the issue #1270 by allowing to pass full search criteria to the loadNavigationElements method of useNavigation composable.

Type of change

ToDo's

Screenshots (if applicable)

Additional context

Copy link

vercel bot commented Dec 18, 2024

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

Name Status Preview Updated (UTC)
shopware-frontends-docs ✅ Ready (Inspect) Visit Preview Dec 20, 2024 11:41am

Copy link
Collaborator

@patzick patzick left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!
Opening params to match endpoint params is a good approach, let's just make it by extending params, not adding additional one :)

packages/composables/src/useNavigation/useNavigation.ts Outdated Show resolved Hide resolved
packages/composables/src/useNavigation/useNavigation.ts Outdated Show resolved Hide resolved
packages/composables/src/useNavigation/useNavigation.ts Outdated Show resolved Hide resolved
.changeset/rich-snakes-suffer.md Outdated Show resolved Hide resolved
Copy link

pkg-pr-new bot commented Dec 19, 2024

Open in Stackblitz

@shopware/api-client

npm i https://pkg.pr.new/shopware/frontends/@shopware/api-client@1540

@shopware-pwa/cms-base

npm i https://pkg.pr.new/shopware/frontends/@shopware-pwa/cms-base@1540

@shopware-pwa/composables-next

npm i https://pkg.pr.new/shopware/frontends/@shopware-pwa/composables-next@1540

@shopware-pwa/helpers-next

npm i https://pkg.pr.new/shopware/frontends/@shopware-pwa/helpers-next@1540

@shopware-pwa/nuxt3-module

npm i https://pkg.pr.new/shopware/frontends/@shopware-pwa/nuxt3-module@1540

@shopware/api-gen

npm i https://pkg.pr.new/shopware/frontends/@shopware/api-gen@1540

commit: 4754dfd

Co-authored-by: Patryk Tomczyk <13100280+patzick@users.noreply.github.com>
@kasztof
Copy link
Contributor Author

kasztof commented Dec 19, 2024

Thanks for the feedback @patzick! I was looking at useCategorySearch() while making these changes and probably got too inspired by this, since it also has Criteria as an additional parameter. I applied all suggested changes 👍

Is there any reason it's not done the same way as you suggested here in the search method of useCategorySearch?

readCategory operation defines both components["schemas"]["Criteria"] & components["schemas"]["ProductListingCriteria"] for the body, but search options only allow for Schemas["Criteria"].

@kasztof kasztof requested a review from patzick December 19, 2024 20:46
Copy link
Collaborator

@patzick patzick left a comment

Choose a reason for hiding this comment

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

Thanks! 🙌

That potentially could also be unified, I guess it was also about the default associations, but that's another case

@patzick patzick merged commit 3778061 into shopware:main Dec 20, 2024
7 checks passed
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.

2 participants