mirror of
https://github.com/Expand-sys/ccash-client-js
synced 2026-03-22 12:27:09 +11:00
fix: add password in body to adminAddUser
This commit is contained in:
parent
aa57f32701
commit
80ca0b6800
2 changed files with 12 additions and 6 deletions
|
|
@ -73,7 +73,7 @@ export class CCashClient implements Partial<ICCashClient> {
|
|||
);
|
||||
}
|
||||
|
||||
setBal(user: string, pass: string, amount: number): Promise<number> {
|
||||
setBalance(user: string, pass: string, amount: number): Promise<number> {
|
||||
return this.http
|
||||
.patch(`/admin/${user}/bal`, undefined, {
|
||||
headers: { Password: pass },
|
||||
|
|
@ -120,13 +120,18 @@ export class CCashClient implements Partial<ICCashClient> {
|
|||
adminAddUser(
|
||||
user: string,
|
||||
pass: string,
|
||||
initialPass: string,
|
||||
initialBalance: number
|
||||
): Promise<User> {
|
||||
return this.http
|
||||
.post(`/user/${user}`, undefined, {
|
||||
.post(
|
||||
`/user/${user}`,
|
||||
{ password: initialPass },
|
||||
{
|
||||
headers: { Password: pass },
|
||||
params: { init_bal: initialBalance },
|
||||
})
|
||||
}
|
||||
)
|
||||
.then(
|
||||
(response) =>
|
||||
this.handleError(response) || this.serialize(User, { user })
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export interface ICCashClient {
|
|||
|
||||
// Meta usage
|
||||
changePassword(user: string, pass: string, newPass: string): Promise<User>;
|
||||
setBal(user: string, pass: string, amount: number): Promise<number>;
|
||||
setBalance(user: string, pass: string, amount: number): Promise<number>;
|
||||
|
||||
// System usage
|
||||
help(): Promise<string>;
|
||||
|
|
@ -29,6 +29,7 @@ export interface ICCashClient {
|
|||
adminAddUser(
|
||||
user: string,
|
||||
pass: string,
|
||||
initialPass: number,
|
||||
initialBalance: number
|
||||
): Promise<User>;
|
||||
deleteUser(user: string, pass: string): Promise<User>;
|
||||
|
|
|
|||
Loading…
Reference in a new issue