This method will return all users available in the system. It is used to create a task screen to fetch a user list to choose for a task assignment. The method is as follows:
@GetMapping("/getAllUsers")
fun getUsers(model:Model):String{
var users: List<User>? = userRepository?.findAll() ?: null;
model.addAttribute("users",users)
return "users"
}
We call it from the model popup in the add task screen. The UI will be rendered by the Thymeleaf template—users.html.