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

Add listAnnoucements

This commit is contained in:
ZelrDev 2022-02-06 15:14:48 +00:00
parent 114c3d86c6
commit 685dddbcc7
2 changed files with 42 additions and 1 deletions

View file

@ -2,6 +2,7 @@ import Undici from "undici";
import { RequestOptions } from "undici/types/dispatcher";
import {
ActivityResponse,
AnnoucementsResponse,
BadgesResponse,
BehaviourResponse,
DetentionsResponse,
@ -208,6 +209,18 @@ export class ClasschartsClient {
}
);
}
/**
* Lists the logged in student's annoucements
* @returns Array of annoucements
*/
async listAnnoucements(): Promise<AnnoucementsResponse> {
return await this.makeAuthedRequest(
API_BASE + "/annoucements/" + this.studentId,
{
method: "GET",
}
);
}
/**
* Gets the logged in student's detentions
* @returns Array of detentions