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

Filtering/sorting by association fields #231

Open
gibonu opened this issue Jun 22, 2018 · 0 comments
Open

Filtering/sorting by association fields #231

gibonu opened this issue Jun 22, 2018 · 0 comments

Comments

@gibonu
Copy link

gibonu commented Jun 22, 2018

hi is there any way to filter/sort by association fields?

I have a Project model with FK to User as project manager. I have turned on associations in sequelize and epilogue but now I want to be able to select all projects with project manager last name being XXXX.

It is achievable via sequelize so I assume it should be somehow possible with epilogue as well?
My resources are defined like that:

var resources = Object.keys(app.get('models'));
resources.pop();

resources.forEach(function (resource) {
var res = epilogue.resource({
model: app.get('models')[resource],
endpoints: ['/' + resource, '/' + resource + '/:id'],
associations: true,
});
});

where models are sequelize models

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

No branches or pull requests

1 participant