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

Change order of artwork stream #19

Open
jvolker opened this issue Feb 19, 2020 · 0 comments
Open

Change order of artwork stream #19

jvolker opened this issue Feb 19, 2020 · 0 comments

Comments

@jvolker
Copy link
Collaborator

jvolker commented Feb 19, 2020

Following up #7, I was having a look at how to change the order of the public stream and couldn't figure it out. @jmwohl could you help, please?

I want to create an order that shows artworks without preview images last and then orders by either creation date or user likes (through a switch in the UI).

I thought it should be enough to modify the filter object of this line:

return artwork.fetchStream({ skip }).then(

… but the corresponding article in the Loopback doc doesn't show how to use computed properties, which I think we would need for the thumbnail order thumb_url !== ''. It also doesn't explain how to aggregate data, which we need for the user likes as they are stored in the user channels.

I found this answer on Stackoverflow mentioning Loopback Operation hooks. It appears to me that those are part of the API server and can't be used in the API client. Is that right?

Thanks.

@jvolker jvolker changed the title Custom order of artwork stream Change order of artwork stream Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant