mirror of
https://github.com/classchartsapi/classcharts-api-js.git
synced 2026-05-14 11:58:13 +00:00
Update baseClient.ts
This commit is contained in:
parent
cebc415b01
commit
fb45ed5f08
1 changed files with 0 additions and 33 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue