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

Update baseClient.ts

This commit is contained in:
Veloi 2023-09-18 17:59:34 +01:00 committed by GitHub
parent cebc415b01
commit fb45ed5f08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,8 +16,6 @@ import type {
HomeworksResponse, HomeworksResponse,
LessonsResponse, LessonsResponse,
PupilFieldsResponse, PupilFieldsResponse,
RewardPurchaseResponse,
RewardsResponse,
} from "../types.ts"; } from "../types.ts";
import { PING_INTERVAL } from "../utils/consts.ts"; import { PING_INTERVAL } from "../utils/consts.ts";
@ -305,37 +303,6 @@ export class BaseClient {
) )
); );
} }
/**
* Gets the current student's rewards shop
* @returns Array of purchasable items
*/
async getRewards(): Promise<RewardsResponse> {
return (
await this.makeAuthedRequest(
this.API_BASE + "/rewards/" + this.studentId,
{
method: "GET",
},
)
);
}
/**
* Purchase a reward item from the current student's rewards shop
* @param itemId number
* @returns An object containg balence and id
*/
async postRewardPurchase(itemId: number): Promise<RewardPurchaseResponse> {
return (
await this.makeAuthedRequest(
this.API_BASE + "/purchase/" + itemId,
{
method: "POST",
body: `pupil_id=${this.studentId}`
}
)
)
}
/** /**
* Gets the current student's pupil fields * Gets the current student's pupil fields
* @returns Array of stats * @returns Array of stats