1
0
Fork 0
mirror of https://github.com/classchartsapi/classcharts-api-js.git synced 2026-05-11 18:59:05 +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);
let responseJSON: ClassChartsResponse<unknown, unknown>;
// deno-lint-ignore no-explicit-any
let responseJSON: ClassChartsResponse<any, any>;
try {
responseJSON = await request.json();
} catch {
@ -115,8 +116,7 @@ export class BaseClient {
if (responseJSON.success == 0) {
throw new Error(responseJSON.error);
}
// deno-lint-ignore no-explicit-any
return responseJSON as unknown as any;
return responseJSON;
}
/**
* Gets general information about the current student