The JSONAPI documentation explains there are two ways to update relationships.
The first one “Updating a Resource’s Relationships” uses a PATCH request of the entire model and it’s relations. Like so:
PATCH /articles/1 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"data": {
"type": "articles",
"id": "1",
"relationships": {
"author": {
"data": { "type": "people", "id": "1" }
}
}
}
}
This is how my Ember app works right out of the box.
I prefer using the second “Updating Relationships” where the relationship link is used:
PATCH /articles/1/relationships/author HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"data": { "type": "people", "id": "12" }
}
Does Ember Data 1.13.8 support this?
My current build uses:
- Ember: 1.13.7
- Ember Data: 1.13.8
- jQuery: 1.11.3