From effcb01f70572ade0ec5879b3cfe495e227541b2 Mon Sep 17 00:00:00 2001 From: kokororin Date: Wed, 15 Apr 2020 11:31:10 +0800 Subject: [PATCH] fix bookmark request method --- src/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 0b60049..677a55d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -539,7 +539,6 @@ export default class PixivApp { return this.fetch('/v2/illust/bookmark/detail', { params }) } - // This endpoint doesn't exist illustBookmarkAdd(id: number, params?: PixivParams): Promise { if (!id) { return Promise.reject(new Error('illustId required')) @@ -550,10 +549,9 @@ export default class PixivApp { ...params, } - return this.fetch('/v2/illust/bookmark/add', { params }) + return this.fetch('/v2/illust/bookmark/add', { data: params }) } - // This endpoint doesn't exist illustBookmarkDelete(id: number, params?: PixivParams): Promise { if (!id) { return Promise.reject(new Error('illustId required')) @@ -562,7 +560,7 @@ export default class PixivApp { illustId: id, ...params, } - return this.fetch('/v1/illust/bookmark/delete', { params }) + return this.fetch('/v1/illust/bookmark/delete', { data: params }) } userBookmarkTagsIllust(