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) {