clemens-tolboom / drupal-8-rest-angularjs

Test angularjs frontend for Drupal 8 ReST
MIT License
48 stars 16 forks source link

Fix taxonomy names #9

Closed clemens-tolboom closed 9 years ago

clemens-tolboom commented 9 years ago

Each node has _links with for articles field_tag containing href to terms.

"http://drupal.d8/rest/relation/node/article/field_tags": [
      {
        "href": "http://drupal.d8/taxonomy/term/5",
        "lang": "en"
      }
    ]

These values are mapped to

_internals.field_tags[{"target_id":"16"},{"target_id":"18"}]

We need to find a way to filter out from the the full list from /taxonomy/list

[
{"name":"Aap","tid":"18","vid":"tags"}
{"name":"Noot","tid":"17","vid":"tags"}
{"name":"Mies","tid":"16","vid":"tags"}
]

We have $scope.tags for lookup values of $scope.node._internals.field_tags.

<li ng-repeat="tag in node._internals.field_tags | filter:filterByTag">

Filtering should be the other way around.

clemens-tolboom commented 9 years ago

This needs a transformResponse making the list a hash of tid