Hello everyone,
I would be grateful if someone can help me with part my CRUD functionality.
Project Link: GitHub - chininchu/Dining-Review-API
Here is my code:
public ResponseEntity<List> searchRestaurantsByZipCodeAndAllergyScores(@RequestParam String zipCode, @RequestParam String allergy) {
List<Restaurant> restaurants = restaurantService.getRestaurantsByZipCodeAndAllergyScores(zipCode, allergy);
if (!restaurants.isEmpty()) {
return ResponseEntity.ok(restaurants);
} else {
return ResponseEntity.noContent().build();
}
}
When I run the application, and make a request to this domain the http://localhost:8080/api/restaurants/search
I see that it attempts to communicate with the mySQL database but I am not getting a JSON response. Please correct me if I am wrong about this ?. Thanks.