1
0
Fork 0
mirror of https://github.com/classchartsapi/classcharts-api-js.git synced 2026-05-14 03:56:59 +00:00

style: eslint

This commit is contained in:
James Cook 2022-01-31 22:38:17 +00:00
parent 0801d3aae0
commit df58288b2c
6 changed files with 1146 additions and 3 deletions

View file

@ -76,11 +76,12 @@ export class ClasschartsClient {
});
if (request.statusCode != 302 || !request.headers["set-cookie"])
throw new Error("Unauthenticated: Classcharts returned an error");
let cookies = request.headers["set-cookie"];
const cookies = request.headers["set-cookie"];
for (let i = 0; i < cookies.length; i++) {
cookies[i] = cookies[i].substring(0, cookies[i].indexOf(";"));
}
this.authCookies = cookies;
this.authCookies = cookies
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let sessionID: any = decodeURI(cookies[2])
.replace(/%3A/g, ":")
.replace(/%2C/g, ",");
@ -151,7 +152,7 @@ export class ClasschartsClient {
params.append("display_date", String(options?.displayDate));
options?.fromDate && params.append("from", String(options?.fromDate));
options?.toDate && params.append("to", String(options?.toDate));
let data: Array<Homework> = await this.makeAuthedRequest(
const data: Array<Homework> = await this.makeAuthedRequest(
API_BASE + "/homeworks/" + this.studentId + "?" + params.toString(),
{
method: "GET",

View file

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
export interface Student {
id: number;
name: string;