Skip to content

Commit 2c31d42

Browse files
committed
fix(kitsu): use ID-less URL for bulk extension in PATCH requests
1 parent 36805cc commit 2c31d42

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

packages/kitsu/src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,9 @@ export default class Kitsu {
248248
camelCaseTypes: this.camel,
249249
pluralTypes: this.plural
250250
})
251+
const fullURL = body?.id ? `${url}/${body.id}` : url
251252
const { data } = await this.axios.patch(
252-
`${url}/${body.id}`,
253+
fullURL,
253254
serialData,
254255
{ headers: Object.assign(this.headers, headers) }
255256
)

packages/kitsu/src/patch.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ describe('kitsu', () => {
5353
done()
5454
})
5555

56+
it('sends bulk data in request', async done => {
5657
it('throws an error if missing a JSON object body', async () => {
5758
expect.assertions(1)
5859
const api = new Kitsu()

0 commit comments

Comments
 (0)