From 6fd7a91422c74f5b0c2bea951db160e3d6bb4dfc Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Sun, 13 Jun 2021 22:05:58 +0100 Subject: [PATCH] fix: correct password as body calls --- src/CCashClient.ts | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/CCashClient.ts b/src/CCashClient.ts index 58a3310..e7319f5 100644 --- a/src/CCashClient.ts +++ b/src/CCashClient.ts @@ -56,11 +56,7 @@ export class CCashClient implements ICCashClient { changePassword(user: string, pass: string, newPass: string): Promise { return this.http - .patch( - `/${user}/pass/change`, - { password: newPass }, - { headers: { Password: pass } } - ) + .patch(`/${user}/pass/change`, newPass, { headers: { Password: pass } }) .then( (response) => this.handleError(response) || this.serialize(User, { user }) @@ -122,14 +118,10 @@ export class CCashClient implements ICCashClient { initialBalance: number ): Promise { return this.http - .post( - `/user/${user}`, - { password: initialPass }, - { - headers: { Password: pass }, - params: { init_bal: initialBalance }, - } - ) + .post(`/user/${user}`, initialPass, { + headers: { Password: pass }, + params: { init_bal: initialBalance }, + }) .then( (response) => this.handleError(response) || this.serialize(User, { user })