Skip to content

Commit e37b7ad

Browse files
committed
docs(kitsu): document usage of the bulk extension
1 parent f793988 commit e37b7ad

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

packages/kitsu/src/index.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,14 @@ export default class Kitsu {
212212
* @returns {Object} JSON-parsed response
213213
* @example <caption>Update a post</caption>
214214
* api.update('posts', {
215-
* id: '12345678',
215+
* id: '1',
216216
* content: 'Goodbye World'
217217
* })
218+
* @example <caption>Update multiple resources (API must support the Bulk Extension)</caption>
219+
* api.update('posts', [
220+
* { id: '1', content: 'Hello World' },
221+
* { id: '2', content: 'Another post' }
222+
* ])
218223
*/
219224
async patch (model, body, headers = {}) {
220225
try {
@@ -258,6 +263,11 @@ export default class Kitsu {
258263
* type: 'users'
259264
* }
260265
* })
266+
* @example <caption>Create multiple resources (API must support the Bulk Extension)</caption>
267+
* api.create('posts', [
268+
* { content: 'Hello World' },
269+
* { content: 'Another post' }
270+
* ])
261271
*/
262272
async post (model, body, headers = {}) {
263273
try {
@@ -288,8 +298,10 @@ export default class Kitsu {
288298
* @param {string|number|Array} id Resource ID to remove. Pass an array of IDs to delete multiple resources (Bulk Extension)
289299
* @param {Object} headers Additional headers to send with request
290300
* @returns {Object} JSON-parsed response
291-
* @example <caption>Remove a user's post</caption>
301+
* @example <caption>Remove a single resource</caption>
292302
* api.delete('posts', 123)
303+
* @example <caption>Remove multiple resources (API must support the Bulk Extension)</caption>
304+
* api.delete('posts', [ 1, 2 ])
293305
*/
294306
async delete (model, id, headers = {}) {
295307
try {

0 commit comments

Comments
 (0)