mirror of
https://gitlab.com/etc404/software-engineering-project.git
synced 2026-05-10 20:52:58 +00:00
Update file ProfileController.java
This commit is contained in:
@@ -42,21 +42,7 @@ public class ProfileController {
|
|||||||
|
|
||||||
model.addAttribute("profile", profile);
|
model.addAttribute("profile", profile);
|
||||||
model.addAttribute("updateProfileDto", updateProfileDto);
|
model.addAttribute("updateProfileDto", updateProfileDto);
|
||||||
|
model.addAttribute("guest", false);
|
||||||
return "my-profile";
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/my-profile/update")
|
|
||||||
public String updateMyProfile(@ModelAttribute UpdateProfileDto dto, Principal principal) {
|
|
||||||
String username = principal.getName();
|
|
||||||
userService.updateProfile(username, dto);
|
|
||||||
return "redirect:/my-profile";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
updateProfileDto.setBio(profile.getBio());
|
|
||||||
|
|
||||||
model.addAttribute("profile", profile);
|
|
||||||
model.addAttribute("updateProfileDto", updateProfileDto);
|
|
||||||
|
|
||||||
return "my-profile";
|
return "my-profile";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user