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