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

Updated Docs, made corrects as requested to the js docs comments.

This commit is contained in:
ChrisPhillips-cminion 2022-03-10 09:23:40 +00:00
parent 4f5e091d9f
commit ac2fbf8bc7
24 changed files with 72 additions and 65 deletions

View file

@ -27,8 +27,7 @@ export class ClasschartsClient {
protected API_BASE = "";
/**
*
* @param studentCode Classcharts student code
* @param dateOfBirth Student's date of birth
* @param API_BASE Base API URL, this is different depending if its called as a parent or student
*/
constructor(API_BASE: string) {
this.API_BASE = API_BASE

View file

@ -22,12 +22,12 @@ import { API_BASE_PARENT, BASE_URL } from "./consts";
* The base client
*/
export class ClasschartsParentClient extends ClasschartsClient {
public password = "";
public email = "";
private password = "";
private email = "";
/**
*
* @param studentCode Classcharts student code
* @param dateOfBirth Student's date of birth
* @param email Parents email address
* @param password Parents password
*/
constructor(email: string, password: string) {
super(API_BASE_PARENT)
@ -36,7 +36,7 @@ export class ClasschartsParentClient extends ClasschartsClient {
}
/**
* Initialises the client and authenticates with classcharts
* Logs the user in the client and authenticates with classcharts
*/
async login(): Promise<void> {
if (!this.email) throw new Error("Email not inputted");
@ -73,15 +73,16 @@ export class ClasschartsParentClient extends ClasschartsClient {
this.sessionId = sessionID.session_id;
let pupil = await this.getPupil();
let pupil = await this.getPupils();
this.studentId = pupil[0].id;
this.studentName = pupil[0].pupil_name;
}
/**
* Get Pupil details
* @returns an array fo Pupils connected to this parent's account
*/
async getPupil(options?: GetActivityOptions): Promise<ActivityResponse> {
async getPupils(): Promise<ActivityResponse> {
let pupils = this.makeAuthedRequest(
this.API_BASE + "/pupils",
{