admin
admin copied to clipboard
props become undefined after calling another URI
Hi there ,
I have a weird bug with react admin, the bug occurs in the
<Show {...props}>
<SimpleShowLayout>
<TextField source="givenName"/>
<TextField source="familyName"/>
<DateField source="email"/>
<ReferenceManyField label="" reference="user-projects" target="user" >
<Datagrid {...props}>
<ReferenceField label="Invitation receiver" source="user" reference="users" allowEmpty sortBy="user.givenName">
<TextField source="givenName" />
</ReferenceField>
<TextField source="status"/>
</Datagrid>
</ReferenceManyField>
</SimpleShowLayout>
</Show>
CALL 1 : The
GET /api/users/1
{
@context: "/api/contexts/User"
@id: "/api/users/1"
@type: "http://schema.org/Person"
email: "[email protected]"
givenName: "Martin"
familyName: "Lelong"
}
CALL 2 : The call attached to the <ReferenceManyField> get the JSON below :
[
{
@id: "/api/user-projects/1"
@type: "UserProject"
id: "1"
isAdmin: true
isMember: true
status: "ACCEPTED"
user: {
@id: "/api/users/1"
@type: "http://schema.org/Person"
givenName: "Martin"
familyName: "Lelong"
}
}
]
I do not understand why the result of the "call 2" replace the result of the "call 1". I think there is a mechanism that detect the URL of the resource (@id: "/api/users/1") and replace it with the most recent result. The consequence of this is the "email" wich present in the "call 1" becomes undefined after the execution of the "call 2". Any idea ?