Getting all users

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.70.203