Updated to new api structure
This commit is contained in:
parent
5f3649990f
commit
37b4faabf4
@ -19,7 +19,7 @@ export class AccountService {
|
||||
}
|
||||
|
||||
get(id: string): Observable<Account> {
|
||||
const getUrl: string = (id === null) ? `${url}/new` : `${url}/${id}`;
|
||||
const getUrl: string = (id === null) ? `${url}/` : `${url}/${id}`;
|
||||
return <Observable<Account>>this.http.get<Account>(getUrl)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, `get id=${id}`))
|
||||
@ -27,8 +27,7 @@ export class AccountService {
|
||||
}
|
||||
|
||||
list(): Observable<Account[]> {
|
||||
const options = {params: new HttpParams().set('l', '')};
|
||||
return <Observable<Account[]>>this.http.get<Account[]>(url, options)
|
||||
return <Observable<Account[]>>this.http.get<Account[]>(`${url}/list`)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'list'))
|
||||
);
|
||||
@ -36,7 +35,7 @@ export class AccountService {
|
||||
|
||||
paymentAutocomplete(term: string): Observable<Account[]> {
|
||||
const options = {params: new HttpParams().set('q', term).set('t', '1')};
|
||||
return <Observable<Account[]>>this.http.get<Account[]>(url, options)
|
||||
return <Observable<Account[]>>this.http.get<Account[]>(`${url}/query`, options)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'list'))
|
||||
);
|
||||
@ -44,14 +43,14 @@ export class AccountService {
|
||||
|
||||
receiptAutocomplete(term: string): Observable<Account[]> {
|
||||
const options = {params: new HttpParams().set('q', term).set('t', '1')};
|
||||
return <Observable<Account[]>>this.http.get<Account[]>(url, options)
|
||||
return <Observable<Account[]>>this.http.get<Account[]>(`${url}/query`, options)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'list'))
|
||||
);
|
||||
}
|
||||
|
||||
save(account: Account): Observable<Account> {
|
||||
return <Observable<Account>>this.http.post<Account>(`${url}/new`, account, httpOptions)
|
||||
return <Observable<Account>>this.http.post<Account>(`${url}/`, account, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'save'))
|
||||
);
|
||||
@ -81,7 +80,7 @@ export class AccountService {
|
||||
|
||||
autocomplete(term: string): Observable<Account[]> {
|
||||
const options = {params: new HttpParams().set('q', term)};
|
||||
return <Observable<Account[]>>this.http.get<Account[]>(url, options)
|
||||
return <Observable<Account[]>>this.http.get<Account[]>(`${url}/query`, options)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'autocomplete'))
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user