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

fix: use student ID in activity

This commit is contained in:
James Cook 2022-02-11 23:46:48 +00:00 committed by GitHub
parent c848ef5b28
commit 02a2e00fee

View file

@ -51,8 +51,8 @@ export class ClasschartsClient {
let responseJSON;
try {
responseJSON = await request.body.json();
} catch (err) {
throw new Error("Invalid JSON response, check your dates");
} catch {
throw new Error("Invalid JSON response recieved");
}
if (responseJSON.success == 0) {
throw new Error(responseJSON.error);
@ -125,7 +125,7 @@ export class ClasschartsClient {
options?.to && params.append("to", options?.to);
options?.last_id && params.append("last_id", options?.last_id);
return this.makeAuthedRequest(
API_BASE + "/activity/" + this.sessionId + "?" + params.toString(),
API_BASE + "/activity/" + this.studentId + "?" + params.toString(),
{
method: "GET",
}