mirror of
https://github.com/classchartsapi/classcharts-api-js.git
synced 2026-05-14 11:58:13 +00:00
ran deno fmt
This commit is contained in:
parent
d49d02e4ea
commit
7d501d3165
3 changed files with 20 additions and 14 deletions
|
|
@ -312,9 +312,9 @@ export class BaseClient {
|
||||||
await this.makeAuthedRequest(
|
await this.makeAuthedRequest(
|
||||||
this.API_BASE + "/customfields/" + this.studentId,
|
this.API_BASE + "/customfields/" + this.studentId,
|
||||||
{
|
{
|
||||||
method: "GET"
|
method: "GET",
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { API_BASE_STUDENT, BASE_URL } from "~/src/utils/consts.ts";
|
import { API_BASE_STUDENT, BASE_URL } from "~/src/utils/consts.ts";
|
||||||
import { BaseClient } from "~/src/core/baseClient.ts";
|
import { BaseClient } from "~/src/core/baseClient.ts";
|
||||||
import { parseCookies } from "~/src/utils/utils.ts";
|
import { parseCookies } from "~/src/utils/utils.ts";
|
||||||
import { RewardPurchaseResponse, RewardsResponse } from "~/src/types.ts"
|
import { RewardPurchaseResponse, RewardsResponse } from "~/src/types.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Student Client
|
* Student Client
|
||||||
|
|
@ -84,9 +84,9 @@ export class StudentClient extends BaseClient {
|
||||||
this.API_BASE + "/purchase/" + itemId,
|
this.API_BASE + "/purchase/" + itemId,
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: `pupil_id=${this.studentId}`
|
body: `pupil_id=${this.studentId}`,
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
src/types.ts
18
src/types.ts
|
|
@ -336,13 +336,16 @@ export interface Detention {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DetentionsData = Array<Detention>
|
export type DetentionsData = Array<Detention>;
|
||||||
|
|
||||||
export interface DetentionsMeta {
|
export interface DetentionsMeta {
|
||||||
detention_alias_plural: string
|
detention_alias_plural: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DetentionsResponse = ClassChartsResponse<DetentionsData, DetentionsMeta>;
|
export type DetentionsResponse = ClassChartsResponse<
|
||||||
|
DetentionsData,
|
||||||
|
DetentionsMeta
|
||||||
|
>;
|
||||||
|
|
||||||
export interface Announcement {
|
export interface Announcement {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
@ -456,7 +459,7 @@ export type RewardsData = {
|
||||||
purchased: boolean;
|
purchased: boolean;
|
||||||
purchased_count: string;
|
purchased_count: string;
|
||||||
price_balance_difference: number;
|
price_balance_difference: number;
|
||||||
}[]
|
}[];
|
||||||
|
|
||||||
export interface RewardsMeta {
|
export interface RewardsMeta {
|
||||||
pupil_score_balance: number;
|
pupil_score_balance: number;
|
||||||
|
|
@ -470,7 +473,10 @@ export interface RewardPurchaseData {
|
||||||
balance: number;
|
balance: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type RewardPurchaseResponse = ClassChartsResponse<RewardPurchaseData, []>;
|
export type RewardPurchaseResponse = ClassChartsResponse<
|
||||||
|
RewardPurchaseData,
|
||||||
|
[]
|
||||||
|
>;
|
||||||
|
|
||||||
export interface PupilFieldsData {
|
export interface PupilFieldsData {
|
||||||
note: string;
|
note: string;
|
||||||
|
|
@ -479,7 +485,7 @@ export interface PupilFieldsData {
|
||||||
name: string;
|
name: string;
|
||||||
graphic: string;
|
graphic: string;
|
||||||
value: string;
|
value: string;
|
||||||
}>
|
}>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PupilFieldsResponse = ClassChartsResponse<PupilFieldsData, []>;
|
export type PupilFieldsResponse = ClassChartsResponse<PupilFieldsData, []>;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue