mirror of
https://github.com/Expand-sys/ccash-client-js
synced 2026-03-22 20:37:09 +11:00
fix: correct password as body calls
This commit is contained in:
parent
27a77d8b30
commit
6fd7a91422
1 changed files with 5 additions and 13 deletions
|
|
@ -56,11 +56,7 @@ export class CCashClient implements ICCashClient {
|
||||||
|
|
||||||
changePassword(user: string, pass: string, newPass: string): Promise<User> {
|
changePassword(user: string, pass: string, newPass: string): Promise<User> {
|
||||||
return this.http
|
return this.http
|
||||||
.patch(
|
.patch(`/${user}/pass/change`, newPass, { headers: { Password: pass } })
|
||||||
`/${user}/pass/change`,
|
|
||||||
{ password: newPass },
|
|
||||||
{ headers: { Password: pass } }
|
|
||||||
)
|
|
||||||
.then(
|
.then(
|
||||||
(response) =>
|
(response) =>
|
||||||
this.handleError(response) || this.serialize(User, { user })
|
this.handleError(response) || this.serialize(User, { user })
|
||||||
|
|
@ -122,14 +118,10 @@ export class CCashClient implements ICCashClient {
|
||||||
initialBalance: number
|
initialBalance: number
|
||||||
): Promise<User> {
|
): Promise<User> {
|
||||||
return this.http
|
return this.http
|
||||||
.post(
|
.post(`/user/${user}`, initialPass, {
|
||||||
`/user/${user}`,
|
|
||||||
{ password: initialPass },
|
|
||||||
{
|
|
||||||
headers: { Password: pass },
|
headers: { Password: pass },
|
||||||
params: { init_bal: initialBalance },
|
params: { init_bal: initialBalance },
|
||||||
}
|
})
|
||||||
)
|
|
||||||
.then(
|
.then(
|
||||||
(response) =>
|
(response) =>
|
||||||
this.handleError(response) || this.serialize(User, { user })
|
this.handleError(response) || this.serialize(User, { user })
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue