feat(composables): add fetch address by ID composable method#2297
Open
Maciej D (mdanilowicz) wants to merge 2 commits intomainfrom
Open
feat(composables): add fetch address by ID composable method#2297Maciej D (mdanilowicz) wants to merge 2 commits intomainfrom
Maciej D (mdanilowicz) wants to merge 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
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 returnCustomerAddress | null. - Updated
UseAddressReturnand 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.
Contributor
Patryk Tomczyk (patzick)
left a comment
There was a problem hiding this comment.
Why do we need this in composable?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to the
useAddresscomposable, 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
getCustomerAddress(addressId)to theuseAddresscomposable, which retrieves a single customer address by its ID using the API. [1] [2] [3]UseAddressReturntype to include the newgetCustomerAddressmethod, and updated documentation to reflect this capability. [1] [2]getCustomerAddress, including cases for successful retrieval and not-found scenarios.Minor code cleanup
updateCustomerAddressfunction for clarity.closes #2076