From 37b4faabf42a1520e8d07e2656d2e3d4a816138e Mon Sep 17 00:00:00 2001 From: tanshu Date: Mon, 11 May 2020 22:46:41 +0530 Subject: [PATCH] Updated to new api structure --- overlord/src/app/core/account.service.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/overlord/src/app/core/account.service.ts b/overlord/src/app/core/account.service.ts index 79f821ff..deec5327 100644 --- a/overlord/src/app/core/account.service.ts +++ b/overlord/src/app/core/account.service.ts @@ -19,7 +19,7 @@ export class AccountService { } get(id: string): Observable { - const getUrl: string = (id === null) ? `${url}/new` : `${url}/${id}`; + const getUrl: string = (id === null) ? `${url}/` : `${url}/${id}`; return >this.http.get(getUrl) .pipe( catchError(this.log.handleError(serviceName, `get id=${id}`)) @@ -27,8 +27,7 @@ export class AccountService { } list(): Observable { - const options = {params: new HttpParams().set('l', '')}; - return >this.http.get(url, options) + return >this.http.get(`${url}/list`) .pipe( catchError(this.log.handleError(serviceName, 'list')) ); @@ -36,7 +35,7 @@ export class AccountService { paymentAutocomplete(term: string): Observable { const options = {params: new HttpParams().set('q', term).set('t', '1')}; - return >this.http.get(url, options) + return >this.http.get(`${url}/query`, options) .pipe( catchError(this.log.handleError(serviceName, 'list')) ); @@ -44,14 +43,14 @@ export class AccountService { receiptAutocomplete(term: string): Observable { const options = {params: new HttpParams().set('q', term).set('t', '1')}; - return >this.http.get(url, options) + return >this.http.get(`${url}/query`, options) .pipe( catchError(this.log.handleError(serviceName, 'list')) ); } save(account: Account): Observable { - return >this.http.post(`${url}/new`, account, httpOptions) + return >this.http.post(`${url}/`, account, httpOptions) .pipe( catchError(this.log.handleError(serviceName, 'save')) ); @@ -81,7 +80,7 @@ export class AccountService { autocomplete(term: string): Observable { const options = {params: new HttpParams().set('q', term)}; - return >this.http.get(url, options) + return >this.http.get(`${url}/query`, options) .pipe( catchError(this.log.handleError(serviceName, 'autocomplete')) );