From b7fe7412d7731d8debaa44c8469b1c184a8aaa32 Mon Sep 17 00:00:00 2001 From: Ludy Date: Sun, 18 May 2025 14:24:21 +0200 Subject: [PATCH] Update src/main/java/stirling/software/SPDF/controller/api/UserController.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../SPDF/controller/api/UserController.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/stirling/software/SPDF/controller/api/UserController.java b/src/main/java/stirling/software/SPDF/controller/api/UserController.java index c1abbb605..aa4ae9a00 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/UserController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/UserController.java @@ -167,6 +167,21 @@ public class UserController { @PreAuthorize("!hasAuthority('ROLE_DEMO_USER')") @PostMapping("/updateUserSettings") + /** + * Updates the user settings based on the provided JSON payload. + * + * @param updates A map containing the settings to update. The expected structure is: + * + * Keys not listed above will be ignored. + * @param principal The currently authenticated user. + * @return A redirect string to the account page after updating the settings. + * @throws SQLException If a database error occurs. + * @throws UnsupportedProviderException If the operation is not supported for the user's provider. + */ public String updateUserSettings(@RequestBody Map updates, Principal principal) throws SQLException, UnsupportedProviderException { log.debug("Processed updates: {}", updates);