Update file ProfileController.java

This commit is contained in:
Madeleine Stamp
2026-04-23 12:50:23 -06:00
parent c4a40c1068
commit 64cd8f2cb5
@@ -42,21 +42,7 @@ public class ProfileController {
model.addAttribute("profile", profile);
model.addAttribute("updateProfileDto", updateProfileDto);
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);
model.addAttribute("guest", false);
return "my-profile";
}