xfscrypt
xfscrypt

Reputation: 276

Loopback: Use multiple include filters in query

I am trying to include multiple related models in a query:

/distributors?filter[include][depots]=drivers&filter[include]=delivery_times

However this seems to duplicate the drivers for each distributor and doesn't return any delivery_time.

This

/distributors?filter[include]=delivery_times

and this:

/distributors?filter[include][depots]=drivers

seems to work fine though.

What could be the issue here?

Upvotes: 0

Views: 109

Answers (1)

F3L1X79
F3L1X79

Reputation: 2675

Multiple include should be done like this on REST:

/distributors?filter[include][0][depots]=drivers&filter[include][1]=delivery_times

Upvotes: 2

Related Questions