I have an Apigility resource with a patchList
method.
The method returns a collection.
I need to set a link to another resource on the returned collection.
So, if a collection looks like this:
{
_links: {
self: '//foo.bar',
},
_embedded: {
foo: []
}
}
I want it to be like so:
{
_links: {
self: '//foo.bar',
bar: '//foo.bar/456'
},
_embedded: {
foo: []
}
}
Now, I have read the docs, and I see how I can add a static link, but I need the link to be set dynamically.
I think I might be able to achieve this by listening to the renderCollection
event, but I was wondering if there is a simpler solution.