Skip to content

Commit

Permalink
docs(kitsu): add clearing of to-one/to-many relationships to api.patc…
Browse files Browse the repository at this point in the history
…h examples
  • Loading branch information
wopian committed May 21, 2020
1 parent dd4bc43 commit 113e60f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/kitsu/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,23 @@ export default class Kitsu {
* @param {Object|Object[]} body Data to send in the request
* @param {Object} [headers] Additional headers to send with the request
* @returns {Object|Object[]} JSON-parsed response
* @example <caption>Update a post</caption>
* @example <caption>Update a resource</caption>
* api.update('posts', {
* id: '1',
* content: 'Goodbye World'
* })
* @example <caption>Update a resource with relationships</caption>
* api.update('posts', {
* content: 'Hello World',
* uploads: {
* id: '167585',
* type: 'uploads'
* }
* })
* @example <caption>Clear to-one relationships from a resource</caption>
* api.update('posts/1/relationships/uploads', null)
* @example <caption>Clear to-many relationships from a resource</caption>
* api.update('posts/1/relationships/uploads', [])
* @example <caption>Update multiple resources (API must support the Bulk Extension)</caption>
* api.update('posts', [
* { id: '1', content: 'Hello World' },
Expand Down

0 comments on commit 113e60f

Please sign in to comment.