Ignore:
Timestamp:
02/09/22 03:14:08 (3 years ago)
Author:
Petar Partaloski <ppartaloski@…>
Branches:
main
Children:
967b414
Parents:
c02189f
Message:

Added User profiles, improved clarity, improved UI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/wediscussmovies/project/web/controller/UsersController.java

    rc02189f r3fe36de  
    1111import org.springframework.stereotype.Controller;
    1212import org.springframework.ui.Model;
    13 import org.springframework.web.bind.annotation.GetMapping;
    14 import org.springframework.web.bind.annotation.PostMapping;
    15 import org.springframework.web.bind.annotation.RequestMapping;
    16 import org.springframework.web.bind.annotation.RequestParam;
     13import org.springframework.web.bind.annotation.*;
    1714
    1815import java.util.ArrayList;
     
    4239            return "redirect:/register?error=" + exception.getMessage();
    4340        }
     41    }
     42    @GetMapping("/profiles/{id}")
     43    public String getProfilePage(@PathVariable Integer id, Model model){
     44        model.addAttribute("user",userService.findById(id));
     45        model.addAttribute("contentTemplate","usersShow");
     46        return "template";
    4447    }
    4548    @GetMapping("/register")
Note: See TracChangeset for help on using the changeset viewer.