Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialize How get attributes of relationsship #205

Open
rustam87 opened this issue Jun 21, 2019 · 1 comment
Open

Deserialize How get attributes of relationsship #205

rustam87 opened this issue Jun 21, 2019 · 1 comment

Comments

@rustam87
Copy link

rustam87 commented Jun 21, 2019

i have

"included": [
        {
            "type": "author",
            "id": "321321",
            "attributes": {
                "surname": "Nick",
                "name": "Joesn"
            },
new JSONAPIDeserializer({
  author: {
    valueForRelationship: function (relationship) {
      return {
        id: relationship.id,
     // There i have only id = 321321
    // How get  "surname" and  "name"
      };
    }
  }
})
@rustam87
Copy link
Author

i found

valueForRelationship: function (relationship, included) {
return {
id: relationship.id,
name: included.name
};
}

please, add it to doc, because it very important

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant