I am working with restaurant objects and have a method that returns all restaurants from the database:
getRestaurantAll() : Observable<Restaurant[]>
{
return this.http.get<Restaurant[]>(`${this.baseUrl}api/Restaurant`)
.pipe(
catchError(this.handleError<Restaurant[]>(`getRestaurantAll`,[]))
);
}
Now, I want to create a similar method with a small modification. The important array properties of Restaurant are TypesOfFood (Pizza, Burgers, Tacos, Ramen) and MethodsOfPayment (Credit, Debit, Cash, Vouchers).
Currently, the user's selections are stored in string variables as userFoodChoice and userPaymentChoice.
I aim to show the user a list of Restaurants that accept both food and payment choices simultaneously.
How can I adjust the above request to filter only the Restaurants that match both of the users' selections?