@@ -215,7 +215,9 @@ export default class Kitsu {
215215 * @memberof Kitsu
216216 * @param {string } model Model to update data in
217217 * @param {Object|Object[] } body Data to send in the request
218- * @param {Object } [headers] Additional headers to send with the request
218+ * @param {Object } [config] Additional configuration
219+ * @param {Object } [config.params] JSON:API request queries. See [#get](#get) for documentation
220+ * @param {Object } [config.headers] Additional headers to send with the request
219221 * @returns {Object|Object[] } JSON-parsed response
220222 * @example <caption>Update a resource</caption>
221223 * api.update('posts', {
@@ -240,8 +242,10 @@ export default class Kitsu {
240242 * { id: '2', content: 'Another post' }
241243 * ])
242244 */
243- async patch ( model , body , headers = { } ) {
245+ async patch ( model , body , config = { } ) {
244246 try {
247+ const headers = merge ( this . headers , config . headers )
248+ const params = merge ( { } , config . params )
245249 const [ resourceModel , url ] = splitModel ( model , {
246250 resourceCase : this . resCase ,
247251 pluralModel : this . plural
@@ -254,7 +258,11 @@ export default class Kitsu {
254258 const { data } = await this . axios . patch (
255259 fullURL ,
256260 serialData ,
257- { headers : Object . assign ( this . headers , headers ) }
261+ {
262+ headers,
263+ params,
264+ paramsSerializer : /* istanbul ignore next */ p => query ( p )
265+ }
258266 )
259267
260268 return deserialise ( data )
0 commit comments