1
0
Fork 0
mirror of https://github.com/classchartsapi/classcharts-api-js.git synced 2026-05-14 11:58:13 +00:00

Misplaced header fix and format

This commit is contained in:
Isaac Hatton 2023-10-08 18:16:11 +00:00
parent e48e30428a
commit 0ae750e4b4

View file

@ -94,20 +94,23 @@ export class ParentClient extends BaseClient {
* @param newPassword New password * @param newPassword New password
* @returns Whether the request was successful * @returns Whether the request was successful
*/ */
async changePassword(currentPassword: string, newPassword: string): Promise<ChangePasswordResponse> { async changePassword(
currentPassword: string,
newPassword: string,
): Promise<ChangePasswordResponse> {
const formData = new URLSearchParams(); const formData = new URLSearchParams();
formData.append("current", current); formData.append("current", currentPassword);
formData.append("new", newPassword); formData.append("new", newPassword);
formData.append("repeat", newPassword); formData.append("repeat", newPassword);
"Content-Type": "application/x-www-form-urlencoded",
});
return ( return (
await this.makeAuthedRequest( await this.makeAuthedRequest(
this.API_BASE + "/password", this.API_BASE + "/password",
{ {
method: "POST", method: "POST",
body: formData, body: formData,
headers: headers, headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
}, },
) )
); );