Ignore:
Timestamp:
02/08/23 12:33:30 (22 months ago)
Author:
DenicaKj <dkorvezir@…>
Branches:
master
Children:
61fed7c
Parents:
2a98e34
Message:

style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/moviezone/web/HomeController.java

    r2a98e34 r86e187f  
    145145//    }
    146146
    147     @GetMapping("/films")
     147    //@GetMapping("/films")
    148148    @Transactional
    149149    public String getFilmsPage(Model model){
     
    158158
    159159
    160 //    @GetMapping("/films")
    161 //    public String getFilmsPage1(Model model,@RequestParam(required = false) Integer id_cinema){
    162 //        model.addAttribute("cinemas",cinemaService.findAllCinemas());
    163 //        if (id_cinema!=null) {
    164 //            model.addAttribute("films",filmService.getFilmsFromCinema(id_cinema));
    165 //        }else{
    166 ////            List<FilmsReturnTable> pom=new LinkedList<>();
    167 //            model.addAttribute("films",filmService.findAllFilms());
    168 //        }
    169 //        model.addAttribute("bodyContent","films");
    170 //        return "master-template";
    171 //    }
     160    @GetMapping("/films")
     161    @Transactional
     162    public String getFilmsPage1(Model model,@RequestParam(required = false) Integer id_cinema){
     163        model.addAttribute("cinemas",cinemaService.findAllCinemas());
     164        if (id_cinema!=null) {
     165            model.addAttribute("films",filmService.getFilmsFromCinema(id_cinema));
     166        }else{
     167            List<FilmsReturnTable> pom=new LinkedList<>();
     168            model.addAttribute("films",filmService.findAllFilms());
     169        }
     170        model.addAttribute("bodyContent","films");
     171        return "master-template";
     172    }
    172173
    173174//    @PostMapping("/getFilmsFromCinema")
Note: See TracChangeset for help on using the changeset viewer.