jsonapi-serializer icon indicating copy to clipboard operation
jsonapi-serializer copied to clipboard

dataLinks on nested collection

Open iancrowther opened this issue 7 years ago • 0 comments

Hey,

I cant seem to work out how to use dataLinks on a nested collection.

{ 
  start: 2,
  limit: 2,
  length: 2,
  users: [ 
    {
       email: '[email protected]',
       name: '[email protected]',
       user_id: 'aaa,
    }
  ],
  total: 81 
}

dataLinks function returns the full object and no the specific user for me to manipulate.

I'm expecting the user from the following but its repeats the dataSet

self: function (dataSet, user) {
  return 'http://localhost:3000/users/' + user.id;
}

Any change you could provide an example?

iancrowther avatar Dec 17 '18 12:12 iancrowther