Closed Gonzalo2683 closed 2 years ago
I found the solution in the tests, looking more deeply I could see that there is a property called typeForAttribute
that receives a function that allows changing the name of the type key.
....
typeForAttribute: function (attribute, data) {
// sometimes this returns undefined
return data.customKey;
},
Hello, The api that I am consuming is from the JSON API of drupal, it has different values for the type field in the relationship, for example:
This is the format in which I need to serialize, If we look at the value for the type field for the relationship we see
type: "user--user",
Serialization example
Results: As you can see, the required value is
node--directors
and notfield_directors
, the same happens withuser--user
anduids
.Is there a way to change the value for the type key? I have read the documentation and did not find any reference on this change.