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

feat: attendance

This commit is contained in:
James Cook 2022-05-25 18:18:31 +01:00
parent f45d857e9a
commit 04b72babcf
4 changed files with 29 additions and 2 deletions

View file

@ -3,6 +3,7 @@ import type { AxiosRequestConfig, AxiosInstance } from "axios";
import type {
ActivityResponse,
AnnouncementsResponse,
AttendanceResponse,
BadgesResponse,
BehaviourResponse,
DetentionsResponse,
@ -216,4 +217,16 @@ export class ClasschartsClient {
}
);
}
/**
* Gets the logged in student's attendance
* @returns Array of dates of attendance
*/
async listAttendance(): Promise<AttendanceResponse> {
return await this.makeAuthedRequest(
this.API_BASE + "/attendance/" + this.studentId,
{
method: "GET",
}
);
}
}