-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Description
Assuming we have following structure:
{
"posts": [
{
"id": 1,
"authorId": 2,
"title": "bar"
},
{
"id": 2,
"authorId": 2,
"title": "foo"
}
],
"comments": [
{
"id": 1,
"postId": 1,
"content": "bar"
}
],
"authors": [
{
"id": 1,
"name": "Artur Delura"
},
{
"id": 2,
"name": "Beata Delura"
}
]
}And there is a request sent to update post title with id 1:
$.ajax({
url: "http://localhost:2121/posts/1",
method: "PUT",
data: {
title: "baz"
}
})Then authorId field in post resource is lost.
I found this issue when I used such request: http://localhost:2121/posts?authorId=1&_embed=comments to get data. After updating I had no posts at all which was very strange :D
I think it's a good idea to change only properties which was intend to be changed. In this case it's only title.
Metadata
Metadata
Assignees
Labels
No labels