From ffdd0b7de7089296ae014412d03202679e3d3361 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 6 Nov 2018 20:53:50 +0900 Subject: [PATCH] =?UTF-8?q?[API]=20=E6=96=87=E5=AD=97=E5=88=97=E3=81=A7?= =?UTF-8?q?=E3=81=AE=E7=9C=9F=E7=90=86=E5=80=A4=E8=A1=A8=E7=8F=BE=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit multipart/formdata では文字列しか送れないっぽい? --- src/server/api/endpoints/drive/files/create.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/api/endpoints/drive/files/create.ts b/src/server/api/endpoints/drive/files/create.ts index 3c334a7c1f..53c62dd868 100644 --- a/src/server/api/endpoints/drive/files/create.ts +++ b/src/server/api/endpoints/drive/files/create.ts @@ -32,8 +32,9 @@ export const meta = { }, isSensitive: { - validator: $.bool.optional, + validator: $.or($.bool, $.str).optional, default: false, + transform: (v: any): boolean => v === true || v === 'true', desc: { 'ja-JP': 'このメディアが「閲覧注意」(NSFW)かどうか', 'en-US': 'Whether this media is NSFW' @@ -41,8 +42,9 @@ export const meta = { }, force: { - validator: $.bool.optional, + validator: $.or($.bool, $.str).optional, default: false, + transform: (v: any): boolean => v === true || v === 'true', desc: { 'ja-JP': 'true にすると、同じハッシュを持つファイルが既にアップロードされていても強制的にファイルを作成します。', }