-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to include a relationship while sending a request? #418
Comments
The first example here has https://github.com/wopian/kitsu/tree/master/packages/kitsu#examples-6 api.create('posts', {
content: 'Hello World',
targetUser: {
id: '42603',
type: 'users'
},
user: {
id: '42603',
type: 'users'
}
}) |
You are right, I was missing the id thanks! |
It seems that including an array of objects as a relationship, results in removing all the attributes of each object except the ID, ex: api.create('posts', {
content: 'Hello World',
users: [{
id: '1',
test: 'test1',
type: 'users'
},
{
id: '2',
test: 'test2',
type: 'users'
}]
}) Result {
"data": {
"type": "posts",
"attributes": {
"content": "Hello World"
},
"relationships": {
"users": {
"data": [
{
"id": "1",
"type": "users"
},
{
"id": "2",
"type": "users"
}
]
}
}
}
} |
Fixed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like the only place the relations are used in the GET request. Any way to send a POST|PATCH request while including a relationship?
The text was updated successfully, but these errors were encountered: