How to get the ``links`` of the JSON API response in the model?

I need to be able to retrieve the links.

For instance:

{ 
   data: {
      id: 1234,
      attributes: {...}
      links: {
         externalLink: '...'
         self: '...',
   }
}

I need to be able to grab that externalLink property. I’ve looked through each property in the model inside the console and im not finding a reference to it anywhere. I’ve also tried model.get(‘content.links’) and it’s not in there.

1 Like

For anyone that’s interested, this is not actually possible. I just got a response on the Ember Data slack channel and they said the best you could do right now is change the normalise functions. Example (just one of the functions):

 normalizeQueryResponse(store, clazz, payload) {
    const result = this._super(...arguments);
    result.meta = result.meta || {};

    if (payload.links) {
      result.meta.externalLink = payload.links.externalLink;
    }

    return result;
  }