From 0cab102f3a09d9bee2ee7e6754c25ebd9e0d0b29 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 20 Feb 2022 01:12:30 +0900 Subject: [PATCH] wip --- packages/backend/src/server/api/call.ts | 4 ++-- .../backend/src/server/api/endpoints/drive/files/create.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/call.ts b/packages/backend/src/server/api/call.ts index ea457d9556..e767b15417 100644 --- a/packages/backend/src/server/api/call.ts +++ b/packages/backend/src/server/api/call.ts @@ -78,8 +78,8 @@ export default async (endpoint: string, user: User | null | undefined, token: Ac } // Cast non JSON input - if (ep.meta.requireFile) { - for (const k of Object.keys(ep.params)) { + if (ep.meta.requireFile && ep.params.properties) { + for (const k of Object.keys(ep.params.properties)) { const param = ep.params.properties![k]; if (['boolean', 'number', 'integer'].includes(param.type ?? '') && typeof data[k] === 'string') { try { diff --git a/packages/backend/src/server/api/endpoints/drive/files/create.ts b/packages/backend/src/server/api/endpoints/drive/files/create.ts index f5791f6ec7..aafb650dd7 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/create.ts @@ -35,7 +35,7 @@ export const meta = { }, } as const; -const paramDef = { +export const paramDef = { type: 'object', properties: { folderId: { type: 'string', format: 'misskey:id', nullable: true, default: null },