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

Allow ListableApiSubResource to not require an id #47

Merged
merged 1 commit into from
Oct 10, 2016

Conversation

neybar
Copy link
Contributor

@neybar neybar commented Aug 18, 2016

I discovered a use case that isn't covered by ProductSkus.all(). Namely the ability to search for a product_option sku. According to the Search a product by SKU section on the curl quickstart, you can search for a sku via /api/v2/products/skus?sku=. This functionality was required to find which product an option sku belonged to. Or at least I couldn't find a better way to search for it.

ProductSkus didn't allow for this type of searching since the productid was mandatory. I altered the _get_all_path method to return an alternate path based on if an id was found or not.

This may not be the best place for this fix since I'm not sure if other ListableApiSubResources will work in this manner with out the parentid.

Thanks for taking a look.

@bookernath bookernath force-pushed the master branch 2 times, most recently from 4419138 to 69472e9 Compare October 5, 2016 04:55
Copy link
Contributor

@bookernath bookernath left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@bookernath bookernath merged commit 0ab0032 into bigcommerce:master Oct 10, 2016
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.

None yet

2 participants