API uses uuid as reference
When the API returns lists of objects (or perhaps elsewhere) that reference the same object (for example owner
of a dataset), the second reference will not be provided as an object in JSON, but only the uuid
of the referred-to object.
Example
The owner
first provided as an object in the dataset with id 2 (and it has uuid 35c5849a-39d7-400d-a242-726b12c92244
).
The second occurrence of the same owner for dataset with id 3 only has a reference "owner": "35c5849a-39d7-400d-a242-726b12c92244"
.
{
"content": [{
"id": 2,
"version": 7,
"uuid": "f5245842-2567-490a-a127-aa35b85d1128",
"owner": {
"uuid": "35c5849a-39d7-400d-a242-726b12c92244",
"id": 1,
"shortName": "CIP",
"name": "International Potato Centre",
"_permissions": {
"create": true,
"read": true,
"write": true,
"delete": true,
"manage": true
}
},
...
"_permissions": {
"create": true,
...
}
}, {
"id": 3,
"version": 6,
"owner": "35c5849a-39d7-400d-a242-726b12c92244",
...
}, {
"id": 4,
"version": 5,
"owner": "35c5849a-39d7-400d-a242-726b12c92244",
...
}],
"totalPages": 1,
...
}
Update the reducer so that it will map the references and convert them to proper objects.
Without this, the application will break with JS errors.