Is there a way to treat API query alias as not nested to make extendModel work?
See original GitHub issueHello,
I’m using extendModel()
to add a function to my api/products
endpoint. This function returns extra data coming from the logged in user.
I have this baseProducts = Restangular.all('products');
restangular object for this endpoint
I also have a query filter for featured products working as api/products?featured=true
If I do baseProducts.getList({"featured": true});
the model is extendend and the function works perfectly.
Now my question begins here,
I would like to have my query filter work with an API alias as api/products/featured
yet when I try to do the following baseProducts.all('featured').getList();
or baseProducts.customGET('featured');
I get the featured products, though the function added throughextendModel()
is not there. I’m not sure, but it seems this is because featured is treated as a nested entity instead of a parameter filtered query
Is there any correct way to do this? Thanks in advance
Issue Analytics
- State:
- Created 9 years ago
- Comments:6
Top GitHub Comments
Okay I’ll close this then. Feel free to re-open if it’s still an issue!
@alejoromano Does customGETLIST work for you?