api-platform / api-platform/admin

props become undefined after calling another URI

Open
#131 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
516
Forks
134
PR merge metrics
No merged PRs in 30d

Description

Hi there ,
I have a weird bug with react admin, the bug occurs in the screen. The code is below
```













```

CALL 1 : The action automatically fetch the user details below :
```
GET /api/users/1
{
@context: "/api/contexts/User"
@id: "/api/users/1"
@type: "http://schema.org/Person"
email: "test1@test.com"
givenName: "Martin"
familyName: "Lelong"
}
```

CALL 2 : The call attached to the 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 ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.