mirror of
https://github.com/Expand-sys/ccash-client-js
synced 2026-03-22 12:27:09 +11:00
fixes for various things
admin routes for adduser and deleteuser get log send funds amount: amount
This commit is contained in:
parent
9182240eb9
commit
5741c0061f
1 changed files with 5 additions and 5 deletions
|
|
@ -28,7 +28,7 @@ export class CCashClient implements ICCashClient {
|
||||||
|
|
||||||
log(user: string, pass: string): Promise<number[]> {
|
log(user: string, pass: string): Promise<number[]> {
|
||||||
return this.http
|
return this.http
|
||||||
.get(`/${user}/bal`, {
|
.get(`/${user}/log`, {
|
||||||
headers: { Password: pass },
|
headers: { Password: pass },
|
||||||
})
|
})
|
||||||
.then((response) => this.handleError(response) || response.data.value);
|
.then((response) => this.handleError(response) || response.data.value);
|
||||||
|
|
@ -43,7 +43,7 @@ export class CCashClient implements ICCashClient {
|
||||||
return this.http
|
return this.http
|
||||||
.post(`/${user}/send/${to}`, undefined, {
|
.post(`/${user}/send/${to}`, undefined, {
|
||||||
headers: { Password: pass },
|
headers: { Password: pass },
|
||||||
params: { amount },
|
params: { amount: amount },
|
||||||
})
|
})
|
||||||
.then((response) => this.handleError(response) || amount);
|
.then((response) => this.handleError(response) || amount);
|
||||||
}
|
}
|
||||||
|
|
@ -67,7 +67,7 @@ export class CCashClient implements ICCashClient {
|
||||||
return this.http
|
return this.http
|
||||||
.patch(`/admin/${user}/bal`, undefined, {
|
.patch(`/admin/${user}/bal`, undefined, {
|
||||||
headers: { Password: pass },
|
headers: { Password: pass },
|
||||||
params: { amount },
|
params: { amount: amount },
|
||||||
})
|
})
|
||||||
.then((response) => this.handleError(response) || amount);
|
.then((response) => this.handleError(response) || amount);
|
||||||
}
|
}
|
||||||
|
|
@ -118,7 +118,7 @@ export class CCashClient implements ICCashClient {
|
||||||
initialBalance: number
|
initialBalance: number
|
||||||
): Promise<User> {
|
): Promise<User> {
|
||||||
return this.http
|
return this.http
|
||||||
.post(`/user/${user}`, initialPass, {
|
.post(`/admin/user/${user}`, initialPass, {
|
||||||
headers: { Password: pass },
|
headers: { Password: pass },
|
||||||
params: { init_bal: initialBalance },
|
params: { init_bal: initialBalance },
|
||||||
})
|
})
|
||||||
|
|
@ -139,7 +139,7 @@ export class CCashClient implements ICCashClient {
|
||||||
|
|
||||||
adminDeleteUser(user: string, pass: string): Promise<User> {
|
adminDeleteUser(user: string, pass: string): Promise<User> {
|
||||||
return this.http
|
return this.http
|
||||||
.delete(`/user/${user}`, { headers: { Password: pass } })
|
.delete(`/admin/user/${user}`, { headers: { Password: pass } })
|
||||||
.then(
|
.then(
|
||||||
(response) =>
|
(response) =>
|
||||||
this.handleError(response) || this.serialize(User, { user })
|
this.handleError(response) || this.serialize(User, { user })
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue