question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to treat API query alias as not nested to make extendModel work?

See original GitHub issue

Hello,

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:closed
  • Created 9 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
daviesgeekcommented, Jun 19, 2016

Okay I’ll close this then. Feel free to re-open if it’s still an issue!

1reaction
daviesgeekcommented, Jun 18, 2016

@alejoromano Does customGETLIST work for you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use nested alias to make the query simpler?
Try this: SELECT Manage, dCheck, firstNested, IF(firstNested="Great",1,0) AS secondNested FROM ( SELECT Manage, dCheck, IF(dCheck="Yes", ...
Read more >
How to Use Aliases in SQL Queries - LearnSQL.com
There are several ways to use aliases in your SQL queries. ... First, we'll use a query that does not have aliases for...
Read more >
Can't alias a nested CASE expression? - Oracle Communities
i get an ora-00905 missing keyword error when i try aliasing the nested CASE expression, but not the outer CASE ("test case"). everything...
Read more >
SOQL Alias a column - apex - Salesforce Stack Exchange
SOQL has very limited aliasing support. You can alias the table, e.g. SELECT a.name FROM Account a , but that's of very little...
Read more >
Alias to NESTED field results in missing column error #15190
Describe the issue I want to add a convenience alias to a nested field column This is the query I am trying to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found