From 5741c0061f390eefe7de76376a0aee05bae494f2 Mon Sep 17 00:00:00 2001 From: Expand-sys <79956551+Expand-sys@users.noreply.github.com> Date: Tue, 15 Jun 2021 17:11:25 +1000 Subject: [PATCH] fixes for various things admin routes for adduser and deleteuser get log send funds amount: amount --- src/CCashClient.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CCashClient.ts b/src/CCashClient.ts index 9c30237..c5ccd0d 100644 --- a/src/CCashClient.ts +++ b/src/CCashClient.ts @@ -28,7 +28,7 @@ export class CCashClient implements ICCashClient { log(user: string, pass: string): Promise { return this.http - .get(`/${user}/bal`, { + .get(`/${user}/log`, { headers: { Password: pass }, }) .then((response) => this.handleError(response) || response.data.value); @@ -43,7 +43,7 @@ export class CCashClient implements ICCashClient { return this.http .post(`/${user}/send/${to}`, undefined, { headers: { Password: pass }, - params: { amount }, + params: { amount: amount }, }) .then((response) => this.handleError(response) || amount); } @@ -67,7 +67,7 @@ export class CCashClient implements ICCashClient { return this.http .patch(`/admin/${user}/bal`, undefined, { headers: { Password: pass }, - params: { amount }, + params: { amount: amount }, }) .then((response) => this.handleError(response) || amount); } @@ -118,7 +118,7 @@ export class CCashClient implements ICCashClient { initialBalance: number ): Promise { return this.http - .post(`/user/${user}`, initialPass, { + .post(`/admin/user/${user}`, initialPass, { headers: { Password: pass }, params: { init_bal: initialBalance }, }) @@ -139,7 +139,7 @@ export class CCashClient implements ICCashClient { adminDeleteUser(user: string, pass: string): Promise { return this.http - .delete(`/user/${user}`, { headers: { Password: pass } }) + .delete(`/admin/user/${user}`, { headers: { Password: pass } }) .then( (response) => this.handleError(response) || this.serialize(User, { user })