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

feat: reward shop methods, get pupil fields and add meta on detentions (#35)

This commit is contained in:
Veloi 2023-09-18 20:46:50 +01:00 committed by GitHub
parent 936057bbd4
commit 41f23e01d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 105 additions and 5 deletions

View file

@ -15,6 +15,7 @@ import type {
GetStudentInfoResponse,
HomeworksResponse,
LessonsResponse,
PupilFieldsResponse,
} from "../types.ts";
import { PING_INTERVAL } from "~/src/utils/consts.ts";
@ -276,7 +277,7 @@ export class BaseClient {
method: "GET",
},
)
).data;
);
}
/**
* Gets the current student's attendance
@ -302,4 +303,18 @@ export class BaseClient {
)
);
}
/**
* Gets the current student's pupil fields
* @returns Array of stats
*/
async getPupilFields(): Promise<PupilFieldsResponse> {
return (
await this.makeAuthedRequest(
this.API_BASE + "/customfields/" + this.studentId,
{
method: "GET",
},
)
);
}
}