diff --git a/src/CCashClient.ts b/src/CCashClient.ts index 425f280..ad86897 100644 --- a/src/CCashClient.ts +++ b/src/CCashClient.ts @@ -73,7 +73,7 @@ export class CCashClient implements Partial { ); } - setBal(user: string, pass: string, amount: number): Promise { + setBalance(user: string, pass: string, amount: number): Promise { return this.http .patch(`/admin/${user}/bal`, undefined, { headers: { Password: pass }, @@ -120,13 +120,18 @@ export class CCashClient implements Partial { adminAddUser( user: string, pass: string, + initialPass: string, initialBalance: number ): Promise { return this.http - .post(`/user/${user}`, undefined, { - headers: { Password: pass }, - params: { init_bal: initialBalance }, - }) + .post( + `/user/${user}`, + { password: initialPass }, + { + headers: { Password: pass }, + params: { init_bal: initialBalance }, + } + ) .then( (response) => this.handleError(response) || this.serialize(User, { user }) diff --git a/src/CCashClient.types.ts b/src/CCashClient.types.ts index d3b37d7..f06c680 100644 --- a/src/CCashClient.types.ts +++ b/src/CCashClient.types.ts @@ -16,7 +16,7 @@ export interface ICCashClient { // Meta usage changePassword(user: string, pass: string, newPass: string): Promise; - setBal(user: string, pass: string, amount: number): Promise; + setBalance(user: string, pass: string, amount: number): Promise; // System usage help(): Promise; @@ -29,6 +29,7 @@ export interface ICCashClient { adminAddUser( user: string, pass: string, + initialPass: number, initialBalance: number ): Promise; deleteUser(user: string, pass: string): Promise;