Choose / Edit / Create customers during billing.
This commit is contained in:
1 parent
c478290da0
commit
6379e5f4e3
14 files changed
+326
-39
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@@ -55,4 +55,13 @@ export class CustomerService {
|
||||
.delete<Customer>(`${url}/${id}`, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'delete'))) as Observable<Customer>;
|
||||
}
|
||||
|
||||
autocomplete(query: string): Observable<Customer[]> {
|
||||
const options = { params: new HttpParams().set('q', query) };
|
||||
return this.http
|
||||
.get<Customer[]>(`${url}/query`, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'autocomplete'))) as Observable<
|
||||
Customer[]
|
||||
>;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user