From 0ae750e4b4a52e81eb2d978b69fdecd7dd599a1f Mon Sep 17 00:00:00 2001 From: Isaac Hatton Date: Sun, 8 Oct 2023 18:16:11 +0000 Subject: [PATCH] Misplaced header fix and format --- src/core/parentClient.ts | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/core/parentClient.ts b/src/core/parentClient.ts index e500ed6..5f1f0ea 100644 --- a/src/core/parentClient.ts +++ b/src/core/parentClient.ts @@ -88,28 +88,31 @@ export class ParentClient extends BaseClient { } throw new Error("No pupil with specified ID returned"); } - /** + /** * Changes the login password for the current parent account * @param currentPassword Current password * @param newPassword New password * @returns Whether the request was successful */ - async changePassword(currentPassword: string, newPassword: string): Promise { - const formData = new URLSearchParams(); - formData.append("current", current); - formData.append("new", newPassword); - formData.append("repeat", newPassword); - "Content-Type": "application/x-www-form-urlencoded", - }); - return ( - await this.makeAuthedRequest( - this.API_BASE + "/password", - { - method: "POST", - body: formData, - headers: headers, + async changePassword( + currentPassword: string, + newPassword: string, + ): Promise { + const formData = new URLSearchParams(); + formData.append("current", currentPassword); + formData.append("new", newPassword); + formData.append("repeat", newPassword); + return ( + await this.makeAuthedRequest( + this.API_BASE + "/password", + { + method: "POST", + body: formData, + headers: { + "Content-Type": "application/x-www-form-urlencoded", }, - ) - ); - } + }, + ) + ); + } }