Search in sources :

Example 1 with CarFilter

use of ua.springboot.web.domain.CarFilter in project Logos_Materials_October_2017 by VolodymyrZavada.

the class CarController method showCarsByMake.

@GetMapping("/cars/filter")
public String showCarsByMake(@PageableDefault Pageable pageable, @RequestParam("search") String search, Model model) {
    CarFilter filter = null;
    if (search != null) {
        filter = new CarFilter(search);
    }
    Page<Car> cars = carService.findAllCarsByMake(pageable, filter);
    model.addAttribute("carsList", cars.getContent());
    return "car/cars";
}
Also used : CarFilter(ua.springboot.web.domain.CarFilter) Car(ua.springboot.web.entity.Car) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

GetMapping (org.springframework.web.bind.annotation.GetMapping)1 CarFilter (ua.springboot.web.domain.CarFilter)1 Car (ua.springboot.web.entity.Car)1