Skip to content

Commit

Permalink
Fix responseCode when userSetting not found (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwithi committed Dec 6, 2023
1 parent 4559044 commit 122e543
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/isf/menu/rest/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,12 @@ public ResponseEntity<UserSettingDTO> getUserSettingByUser(@PathVariable(name =
LOGGER.info("Retrieve the userSetting By user {} and configName {}.", userName, configName);
List<UserSetting> userSettings = userSettingManager.getUserSettingByUserName(userName);
if (userSettings == null || userSettings.isEmpty()) {
LOGGER.info("UserSetting not found.");
throw new OHAPIException(new OHExceptionMessage("UserSetting not found."));
LOGGER.info("No user settings for the user {}.", userName);
return ResponseEntity.status(HttpStatus.NO_CONTENT).body(null);
}
UserSetting userSetting = userSettingManager.getUserSettingByUserNameConfigName(userName, configName);
if (userSetting == null) {
LOGGER.info("No user settings for the user {}.", userName);
LOGGER.info("No user settings '{}' for the user {}.", configName, userName);
return ResponseEntity.status(HttpStatus.NO_CONTENT).body(null);
}
return ResponseEntity.ok(userSettingMapper.map2DTO(userSetting));
Expand Down

0 comments on commit 122e543

Please sign in to comment.