0
Reading the angular documentation I managed to develop the following search method with filters, but the problem is that I need a search with several filters and not just 1 as shows the code below developed by me. I tried several ways but did not succeed in adding several parameters to the URL...
consultar(filtro: PacienteFiltro): Promise<any> {
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'Authorization': 'Basic ' + btoa('admin' + ':' + 'admin')
}),
params: filtro.nome ? new HttpParams().set('nome', filtro.nome) : {}
};
return this.http.get(this.url, httpOptions)
.toPromise()
.then(response => response);
}