Skip to content

Commit 4d99714

Browse files
authored
chore(kitsu): Fix relationship example in documentation (#782)
1 parent 9fdf3f1 commit 4d99714

5 files changed

Lines changed: 40 additions & 20 deletions

File tree

packages/kitsu/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,16 @@ Create a post on a user's profile feed
600600
api.create('posts', {
601601
content: 'Hello World',
602602
targetUser: {
603-
id: '42603',
604-
type: 'users'
603+
data: {
604+
id: '42603',
605+
type: 'users'
606+
}
605607
},
606608
user: {
607-
id: '42603',
608-
type: 'users'
609+
data: {
610+
id: '42603',
611+
type: 'users'
612+
}
609613
}
610614
})
611615
```

packages/kitsu/example/auth.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ const app = async () => {
2323
await api.create('posts', {
2424
content: 'Hello world',
2525
targetUser: {
26-
id,
27-
type: 'users'
26+
data: {
27+
id,
28+
type: 'users'
29+
}
2830
},
2931
user: {
30-
id,
31-
type: 'users'
32+
data: {
33+
id,
34+
type: 'users'
35+
}
3236
}
3337
})
3438
}

packages/kitsu/example/basic.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ try {
2323
api.create('posts', {
2424
content: 'Hello World',
2525
targetUser: {
26-
id: 42603,
27-
type: 'users'
26+
data: {
27+
id: 42603,
28+
type: 'users'
29+
}
2830
},
2931
user: {
30-
id: 77404,
31-
type: 'users'
32+
data: {
33+
id: 77404,
34+
type: 'users'
35+
}
3236
}
3337
})
3438
.then(response => console.log(response))

packages/kitsu/src/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,16 @@ export default class Kitsu {
317317
* api.create('posts', {
318318
* content: 'Hello World',
319319
* targetUser: {
320-
* id: '42603',
321-
* type: 'users'
320+
* data: {
321+
* id: '42603',
322+
* type: 'users'
323+
* }
322324
* },
323325
* user: {
324-
* id: '42603',
325-
* type: 'users'
326+
* data: {
327+
* id: '42603',
328+
* type: 'users'
329+
* }
326330
* }
327331
* })
328332
* @example <caption>Create multiple resources (API must support the Bulk Extension)</caption>

packages/kitsu/types/index.d.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,16 @@ export default class Kitsu {
275275
* api.create('posts', {
276276
* content: 'Hello World',
277277
* targetUser: {
278-
* id: '42603',
279-
* type: 'users'
278+
* data: {
279+
* id: '42603',
280+
* type: 'users'
281+
* }
280282
* },
281283
* user: {
282-
* id: '42603',
283-
* type: 'users'
284+
* data: {
285+
* id: '42603',
286+
* type: 'users'
287+
* }
284288
* }
285289
* })
286290
* @example <caption>Create multiple resources (API must support the Bulk Extension)</caption>

0 commit comments

Comments
 (0)