Open SafaAlfulaij opened 2 years ago
When dealing with atomic operations, updating local records (added in the operation) requires the lid for the backend to understand what to update.
add
lid
https://github.com/orbitjs/orbit/blob/ea8f97c92d7ee5419910f5752f12c7401a5449e2/packages/%40orbit/jsonapi/src/serializers/jsonapi-resource-identity-serializer.ts#L92-L94
The fix is as simple as this:
if (resourceId !== undefined) { resource.id = resourceId; } else { resource.lid = id }
But needs a bit of testing and checking if JSON:API allows having lid for all requests (atomic and non-atomic) or not.
When dealing with atomic operations, updating local records (
add
ed in the operation) requires thelid
for the backend to understand what to update.https://github.com/orbitjs/orbit/blob/ea8f97c92d7ee5419910f5752f12c7401a5449e2/packages/%40orbit/jsonapi/src/serializers/jsonapi-resource-identity-serializer.ts#L92-L94
The fix is as simple as this:
But needs a bit of testing and checking if JSON:API allows having
lid
for all requests (atomic and non-atomic) or not.