mirror of
https://github.com/classchartsapi/classcharts-api-js.git
synced 2026-05-14 11:58:13 +00:00
fix: use from instead of fromDate for consistancy
This commit is contained in:
parent
6042b7c2f8
commit
eead2535d9
2 changed files with 13 additions and 3 deletions
|
|
@ -155,6 +155,8 @@ export class ClasschartsClient {
|
||||||
|
|
||||||
options?.fromDate && params.append("from", String(options?.fromDate));
|
options?.fromDate && params.append("from", String(options?.fromDate));
|
||||||
options?.toDate && params.append("to", String(options?.toDate));
|
options?.toDate && params.append("to", String(options?.toDate));
|
||||||
|
options?.from && params.append("from", String(options?.from));
|
||||||
|
options?.to && params.append("to", String(options?.to));
|
||||||
const data: Array<Homework> = await this.makeAuthedRequest(
|
const data: Array<Homework> = await this.makeAuthedRequest(
|
||||||
this.API_BASE + "/homeworks/" + this.studentId + "?" + params.toString(),
|
this.API_BASE + "/homeworks/" + this.studentId + "?" + params.toString(),
|
||||||
{
|
{
|
||||||
|
|
|
||||||
14
src/types.ts
14
src/types.ts
|
|
@ -109,13 +109,21 @@ export interface GetHomeworkOptions {
|
||||||
*/
|
*/
|
||||||
displayDate?: DisplayDate;
|
displayDate?: DisplayDate;
|
||||||
/**
|
/**
|
||||||
* From date, in format YYYY-MM-DD
|
* @deprecated Use "from" instead
|
||||||
*/
|
*/
|
||||||
fromDate?: string;
|
fromDate?: string;
|
||||||
/**
|
/**
|
||||||
* To date, in format YYYY-MM-DD
|
* @deprecated Use "to" instead
|
||||||
*/
|
*/
|
||||||
toDate?: string;
|
toDate?: string;
|
||||||
|
/**
|
||||||
|
* From date, in format YYYY-MM-DD
|
||||||
|
*/
|
||||||
|
from?: string;
|
||||||
|
/**
|
||||||
|
* To date, in format YYYY-MM-DD
|
||||||
|
*/
|
||||||
|
to?: string;
|
||||||
}
|
}
|
||||||
export interface ValidatedHomeworkAttachment {
|
export interface ValidatedHomeworkAttachment {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
@ -335,4 +343,4 @@ export interface AttendanceDate {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AttendanceResponse = Array<Record<string, AttendanceDate>>;
|
export type AttendanceResponse = Array<Record<string, AttendanceDate>>;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue