Rate Contract is checked during save and update of Purchase at the backend

This commit is contained in:
2021-09-13 13:01:34 +05:30
parent ceaf93d1cd
commit d34c8ea0a4
5 changed files with 155 additions and 52 deletions

View File

@ -51,8 +51,16 @@ export class ProductService {
.pipe(catchError(this.log.handleError(serviceName, 'delete'))) as Observable<Product>;
}
autocomplete(query: string, extended: boolean = false): Observable<Product[]> {
autocomplete(
query: string,
extended: boolean = false,
date?: string,
vendorId?: string,
): Observable<Product[]> {
const options = { params: new HttpParams().set('q', query).set('e', extended.toString()) };
if (!!vendorId && !!date) {
options.params = options.params.set('v', vendorId as string).set('d', date as string);
}
return this.http
.get<Product[]>(`${url}/query`, options)
.pipe(catchError(this.log.handleError(serviceName, 'autocomplete'))) as Observable<Product[]>;