mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-07-19 21:04:36 +02:00
parent
1faedf18a0
commit
024939de5f
|
@ -100,7 +100,7 @@ public class UserController {
|
|||
|
||||
@GetMapping("/customers/remove/{id}")
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
public String removeCustomer(@PathVariable("id") User user, Model model) {
|
||||
public String removeCustomer(@PathVariable("id") User user) {
|
||||
userManagement.disableUserAccount(user.getUserAccount());
|
||||
return "redirect:/customers";
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ public class UserController {
|
|||
|
||||
@PostMapping("/customers/edit/{id}")
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
public String updateCustomer(@PathVariable("id") User user, @RequestParam String username, @RequestParam String address, Model model) {
|
||||
public String updateCustomer(@PathVariable("id") User user, @RequestParam String username, @RequestParam String address) {
|
||||
user.setUsername(username);
|
||||
user.setAddress(address);
|
||||
userManagement.save(user);
|
||||
|
|
Loading…
Reference in a new issue