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:
parent
dea1a00f13
commit
c5e7b3f24e
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue