Skip to content

feat(composables): add fetch address by ID composable method#2297

Open
Maciej D (mdanilowicz) wants to merge 2 commits intomainfrom
feat/GH-2076
Open

feat(composables): add fetch address by ID composable method#2297
Maciej D (mdanilowicz) wants to merge 2 commits intomainfrom
feat/GH-2076

Conversation

@mdanilowicz
Copy link
Contributor

This pull request introduces a new feature to the useAddress composable, allowing users to fetch a single customer address by its ID. It also includes updates to the composable's type definitions, documentation, and corresponding unit tests to support and verify this new functionality.

New feature: Fetch single customer address by ID

  • Added a new method getCustomerAddress(addressId) to the useAddress composable, which retrieves a single customer address by its ID using the API. [1] [2] [3]
  • Updated the UseAddressReturn type to include the new getCustomerAddress method, and updated documentation to reflect this capability. [1] [2]
  • Added unit tests for getCustomerAddress, including cases for successful retrieval and not-found scenarios.

Minor code cleanup

  • Removed a commented-out line in the updateCustomerAddress function for clarity.

closes #2076

@vercel
Copy link

vercel bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontends-starter-template-extended Ready Ready Preview, Comment Feb 26, 2026 8:11am
frontends-vue-starter-template Ready Ready Preview, Comment Feb 26, 2026 8:11am
old-frontends-demo Ready Ready Preview, Comment Feb 26, 2026 8:11am
shopware-frontends-docs Ready Ready Preview, Comment Feb 26, 2026 8:11am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support in the useAddress composable for fetching a single customer address by its ID, updating the public return type, documentation, and unit tests accordingly.

Changes:

  • Added getCustomerAddress(addressId) to fetch a single address via the Store API list-address endpoint and return CustomerAddress | null.
  • Updated UseAddressReturn and composable docs to include the new method.
  • Added unit tests for the new method and a changeset for release notes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/composables/src/useAddress/useAddress.ts Adds getCustomerAddress implementation, updates return type/docs, and exports the new method from the composable.
packages/composables/src/useAddress/useAddress.test.ts Adds unit tests covering success and not-found cases for getCustomerAddress.
.changeset/large-moose-laugh.md Declares a minor version bump and documents the new composable method.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@patzick Patryk Tomczyk (patzick) left a comment

Choose a reason for hiding this comment

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

Why do we need this in composable?

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.

[COMPOSABLES] useAddress - fetching single address by the ID

3 participants