mirror of
https://github.com/classchartsapi/classcharts-api-js.git
synced 2026-05-14 03:56:59 +00:00
Misplaced header fix and format
This commit is contained in:
parent
e48e30428a
commit
0ae750e4b4
1 changed files with 21 additions and 18 deletions
|
|
@ -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<ChangePasswordResponse> {
|
||||
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<ChangePasswordResponse> {
|
||||
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",
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue