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(composables): shipping and payment method #1564

Merged
merged 2 commits into from
Jan 7, 2025
Merged

fix(composables): shipping and payment method #1564

merged 2 commits into from
Jan 7, 2025

Conversation

mdanilowicz
Copy link
Collaborator

@mdanilowicz mdanilowicz commented Jan 5, 2025

Description

This pull request includes changes to the useOrderDetails composable to ensure that the last element is returned for the payment and shipping methods. This is because the backend returns collections sorted by the entry date. Additionally, new tests have been added to verify this behaviour.

🧰 Improvements to useOrderDetails composable:

  • Updated useOrderDetails to return the last element for payment and shipping methods.
  • Updated the type definitions to reflect the changes in the useOrderDetails composable.

🧪 Tests:

  • Added tests to verify that the current payment and shipping methods are returned correctly.
  • Added tests to handle cases where payment and shipping methods do not exist.

closes #1558

Copy link

vercel bot commented Jan 5, 2025

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

Name Status Preview Updated (UTC)
frontends-demo 🔄 Building (Inspect) Visit Preview Jan 5, 2025 4:01pm
shopware-frontends-docs ✅ Ready (Inspect) Visit Preview Jan 5, 2025 4:01pm

Copy link

pkg-pr-new bot commented Jan 5, 2025

Open in Stackblitz

@shopware/api-client

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

@shopware/api-gen

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

@shopware-pwa/cms-base

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

@shopware-pwa/composables-next

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

@shopware-pwa/helpers-next

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

@shopware-pwa/nuxt3-module

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

commit: b77af9c

@patzick patzick merged commit 3d2f2b5 into main Jan 7, 2025
13 checks passed
@patzick patzick deleted the fix/GH-1558 branch January 7, 2025 08:28
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.

[BUG] useOrderDetails - returns wrong payment method
2 participants