@@ -126,11 +126,10 @@ export class BaseClient {
126126 async getStudentInfo ( ) : Promise < GetStudentInfoResponse > {
127127 const body = new URLSearchParams ( ) ;
128128 body . append ( "include_data" , "true" ) ;
129- const data = await this . makeAuthedRequest ( this . API_BASE + "/ping" , {
129+ return await this . makeAuthedRequest ( this . API_BASE + "/ping" , {
130130 method : "POST" ,
131131 body : body ,
132132 } ) ;
133- return data ;
134133 }
135134 /**
136135 * Gets the current student's activity
@@ -215,13 +214,12 @@ export class BaseClient {
215214
216215 options ?. from && params . append ( "from" , String ( options ?. from ) ) ;
217216 options ?. to && params . append ( "to" , String ( options ?. to ) ) ;
218- const data : HomeworksResponse = await this . makeAuthedRequest (
217+ return await this . makeAuthedRequest (
219218 this . API_BASE + "/homeworks/" + this . studentId + "?" + params . toString ( ) ,
220219 {
221220 method : "GET" ,
222221 } ,
223222 ) ;
224- return data ;
225223 }
226224 /**
227225 * Gets the current student's lessons for a given date
@@ -256,27 +254,23 @@ export class BaseClient {
256254 * @returns Array of announcements
257255 */
258256 async getAnnouncements ( ) : Promise < AnnouncementsResponse > {
259- return (
260- await this . makeAuthedRequest (
261- this . API_BASE + "/announcements/" + this . studentId ,
262- {
263- method : "GET" ,
264- } ,
265- )
257+ return await this . makeAuthedRequest (
258+ this . API_BASE + "/announcements/" + this . studentId ,
259+ {
260+ method : "GET" ,
261+ } ,
266262 ) ;
267263 }
268264 /**
269265 * Gets the current student's detentions
270266 * @returns Array of detentions
271267 */
272268 async getDetentions ( ) : Promise < DetentionsResponse > {
273- return (
274- await this . makeAuthedRequest (
275- this . API_BASE + "/detentions/" + this . studentId ,
276- {
277- method : "GET" ,
278- } ,
279- )
269+ return await this . makeAuthedRequest (
270+ this . API_BASE + "/detentions/" + this . studentId ,
271+ {
272+ method : "GET" ,
273+ } ,
280274 ) ;
281275 }
282276 /**
@@ -290,31 +284,27 @@ export class BaseClient {
290284 const params = new URLSearchParams ( ) ;
291285 options ?. from && params . append ( "from" , options ?. from ) ;
292286 options ?. to && params . append ( "to" , options ?. to ) ;
293- return (
294- await this . makeAuthedRequest (
295- this . API_BASE +
296- "/attendance/" +
297- this . studentId +
298- "?" +
299- params . toString ( ) ,
300- {
301- method : "GET" ,
302- } ,
303- )
287+ return await this . makeAuthedRequest (
288+ this . API_BASE +
289+ "/attendance/" +
290+ this . studentId +
291+ "?" +
292+ params . toString ( ) ,
293+ {
294+ method : "GET" ,
295+ } ,
304296 ) ;
305297 }
306298 /**
307299 * Gets the current student's pupil fields
308300 * @returns Array of stats
309301 */
310302 async getPupilFields ( ) : Promise < PupilFieldsResponse > {
311- return (
312- await this . makeAuthedRequest (
313- this . API_BASE + "/customfields/" + this . studentId ,
314- {
315- method : "GET" ,
316- } ,
317- )
303+ return await this . makeAuthedRequest (
304+ this . API_BASE + "/customfields/" + this . studentId ,
305+ {
306+ method : "GET" ,
307+ } ,
318308 ) ;
319309 }
320310}
0 commit comments