Ignore:
Timestamp:
01/05/23 04:11:40 (23 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
1bd8d1e
Parents:
7d43957
Message:

Added admin view of pending roles and approve functionality

Location:
src/main/java/com/example/autopartz/controller
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/autopartz/controller/HomeController.java

    r7d43957 r676144b  
    102102    public void handleLogin(@RequestParam String username, @RequestParam String password){
    103103        User u = loginService.login(username,password);
    104         System.out.println(u.getName_user());
     104        System.out.println(u.getName());
    105105    }
    106106    @PostMapping("/register")
  • src/main/java/com/example/autopartz/controller/PartController.java

    r7d43957 r676144b  
    5050    }
    5151    @PostMapping("/repairshopdelivery")
    52     public void setRepairShopDelivery(@RequestParam String name, HttpServletResponse response){
     52    public void setRepairShopDelivery(@RequestParam String name, HttpServletResponse response, HttpSession session){
    5353        // insert into project.repair (vin, id_repair_shop, id_service_book) values (1111,3,1)
     54        session.removeAttribute("order");
    5455        try {
    5556            response.sendRedirect("/");
     
    5960    }
    6061    @PostMapping("/homedelivery")
    61     public void setHomeDelivery(@RequestParam String address, HttpServletResponse response){
     62    public void setHomeDelivery(@RequestParam String address, HttpServletResponse response, HttpSession session){
    6263        // insert into delivery (delivery_status, delivery_address,id_user,id_order) values ('in progress','Aerodrom',4,1)
     64        session.removeAttribute("order");
    6365        try {
    6466            response.sendRedirect("/");
  • src/main/java/com/example/autopartz/controller/UserController.java

    r7d43957 r676144b  
    2828    @GetMapping("orders")
    2929    public String getOrdersForUser(Model model, HttpServletRequest request){
    30         Integer id = userService.findByUsername(request.getRemoteUser()).getID_user();
     30        Integer id = userService.findByUsername(request.getRemoteUser()).getId();
    3131        model.addAttribute("userOrders",ordersForUserRepository.findAllByUserid(id));
    3232        model.addAttribute("bodyContent","ordersForUser");
     
    3535    @GetMapping("repairs")
    3636    public String getRepairsForUser(Model model, HttpServletRequest request){
    37         Integer id = userService.findByUsername(request.getRemoteUser()).getID_user();
     37        Integer id = userService.findByUsername(request.getRemoteUser()).getId();
    3838        model.addAttribute("userRepairs",repairsForUserRepository.findAllByUserid(id));
    3939        model.addAttribute("bodyContent","repairsForUser");
     
    4242    @GetMapping("reviews")
    4343    public String getReviewsForUser(Model model,HttpServletRequest request){
    44         Integer id = userService.findByUsername(request.getRemoteUser()).getID_user();
     44        Integer id = userService.findByUsername(request.getRemoteUser()).getId();
    4545        model.addAttribute("userReviews",reviewsForUserRepository.findAllByUserid(id));
    4646        model.addAttribute("bodyContent","reviewsForUser");
Note: See TracChangeset for help on using the changeset viewer.