Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

feat: add Shop.current method #1318

Merged
merged 6 commits into from
Apr 3, 2024
Merged

feat: add Shop.current method #1318

merged 6 commits into from
Apr 3, 2024

Conversation

nullndr
Copy link

@nullndr nullndr commented Apr 2, 2024

Changelog

This PR adds the new method Shop.current() that behaves the same as Shop.all() with the exception of unwrapping the response to return only the data[0] object like the method Customer.find().

@nullndr nullndr requested a review from a team as a code owner April 2, 2024 07:17
@nullndr
Copy link
Author

nullndr commented Apr 2, 2024

I have signed the CLA!

Copy link
Contributor

@paulomarg paulomarg left a comment

Choose a reason for hiding this comment

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

This looks good to me! We should probably copy-paste this method to the other API versions as well so it's available for everyone.

I wonder if it's worth copying one of the tests for the all method just to ensure we don't have regressions.

@nullndr
Copy link
Author

nullndr commented Apr 2, 2024

Hey @paulomarg, I completely agree with you. I'll add the test and the same api to other versions asap

Copy link
Contributor

@paulomarg paulomarg left a comment

Choose a reason for hiding this comment

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

Looks great! If you can please add a changeset (yarn changeset at the project root), I'll merge this :)

@paulomarg
Copy link
Contributor

paulomarg commented Apr 3, 2024

Hey, I took the liberty of tweaking the changeset since this is a minor and not a major version change (we're not changing any existing APIs). Thanks again for contributing, I'll be merging as soon as CI passes :)

@paulomarg paulomarg merged commit 9eb1065 into Shopify:main Apr 3, 2024
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rest resource Shop.all() returns the complete response
2 participants