From 8fb3d9d023f2e1dd5418ef9cf76f64df99d66edf Mon Sep 17 00:00:00 2001 From: Hide_D Date: Thu, 21 Apr 2022 00:24:21 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20get=20API=EC=9D=98=20=EA=B2=BD=EC=9A=B0?= =?UTF-8?q?=20arg=EB=A5=BC=20paramArg=EB=A1=9C=20=EC=A0=84=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/util/callSammoAPI.ts | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/hwe/ts/util/callSammoAPI.ts b/hwe/ts/util/callSammoAPI.ts index 92c4c10e..81cfe4b7 100644 --- a/hwe/ts/util/callSammoAPI.ts +++ b/hwe/ts/util/callSammoAPI.ts @@ -65,17 +65,32 @@ export async function callSammoAPI { + if (method == 'get') { + return ky('api.php', { + searchParams: { + ...paramArgs, + ...(args as typeof paramArgs), + path, + }, + method, + headers: { + 'content-type': 'application/json' + } + }); } - }).json() as ErrorType | ResultType; + return ky('api.php', { + searchParams: { + ...paramArgs, + path, + }, + method, + json: args, + headers: { + 'content-type': 'application/json' + } + }); + })().json() as ErrorType | ResultType; if (!result.result) { if (returnError) {