1
0
Fork 0
mirror of https://github.com/classchartsapi/classcharts-api-js.git synced 2026-05-14 11:58:13 +00:00

fix: improve makeAuthedRequest types

This commit is contained in:
James Cook 2023-09-16 20:05:39 +01:00
parent dea1a00f13
commit c5e7b3f24e

View file

@ -104,7 +104,8 @@ export class BaseClient {
} }
} }
const request = await fetch(path, requestOptions); const request = await fetch(path, requestOptions);
let responseJSON: ClassChartsResponse<unknown, unknown>; // deno-lint-ignore no-explicit-any
let responseJSON: ClassChartsResponse<any, any>;
try { try {
responseJSON = await request.json(); responseJSON = await request.json();
} catch { } catch {
@ -115,8 +116,7 @@ export class BaseClient {
if (responseJSON.success == 0) { if (responseJSON.success == 0) {
throw new Error(responseJSON.error); throw new Error(responseJSON.error);
} }
// deno-lint-ignore no-explicit-any return responseJSON;
return responseJSON as unknown as any;
} }
/** /**
* Gets general information about the current student * Gets general information about the current student