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:
parent
936057bbd4
commit
41f23e01d0
3 changed files with 105 additions and 5 deletions
|
|
@ -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",
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue