Choose / Edit / Create customers during billing.

This commit is contained in:
tanshu committed 2021-09-19 22:42:27 +05:30
1 parent c478290da0
commit 6379e5f4e3
14 files changed
+326 -39

No files matched your search

+10 -1
View File
@@ -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[]
>;
}
}