Closed Bug 911382 Opened 11 years ago Closed 11 years ago

Collections API should also allow filtering on ids for region/carrier/category

Categories

(Marketplace Graveyard :: API, defect, P2)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED
2013-09-10

People

(Reporter: basta, Assigned: mat)

References

Details

(Whiteboard: [qa-])

https://marketplace-dev.allizom.org/api/v1/rocketfuel/collections/?cat&region=2&carrier=0

You can see that this list of results contains collections that have regions other than "2".

Specifying `cat=None` (and other values) does not seem to show only collections for the homepage.
The filtering stuff is because you need to use slugs, not ids. 
https://marketplace-dev.allizom.org/api/v1/rocketfuel/collections/?cat&region=us&carrier=carrierless works

Not sure about cat=None yet, I'll have to look into it.
Oops, my bad, I will. Unless you need IDs? In which case I can try to fix it to really accept both.
Assignee: nobody → mpillard
We're using IDs for everything now, but I'll change it to use slugs.
Ok. For what it's worth, I switched to slug to be compatible with what the App Search API does. I expected IDs to still work, but there must be some django-filter weirdness I had not anticipated.
It's a little wonky that you filter with slugs bug the category/region/carrier fields in the collection objects return IDs.
I'd be really happy if we could take slugs or IDs anywhere.
Target Milestone: --- → 2013-09-03
Target Milestone: 2013-09-03 → 2013-09-10
Summary: Collections API does not seem to be filtering collections. → Collections API does not seem to be filtering collections
Updated description. I opened https://bugzilla.mozilla.org/show_bug.cgi?id=911414 for the filtering on category=''.
Priority: -- → P2
Summary: Collections API does not seem to be filtering collections → Collections API should also allow filtering on ids for region/carrier/category
PR to allow filtering on null and ids: https://github.com/mozilla/zamboni/pull/1082
Status: NEW → ASSIGNED
Fixed in https://github.com/mozilla/zamboni/commit/e2e71c7579fc1ef0f32de896c0c2d6b7f453fcdf

We now allow filtering on both slugs and ids for region/carrier/cat.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.