Skip to content

Commit

Permalink
BXC-4429 update based on PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sharonluong committed Feb 26, 2024
1 parent fb6d9de commit ec0aeda
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public ResponseEntity<Object> getViewSetting(@PathVariable("id") String id) {
public ResponseEntity<Object> updateViewSetting(@RequestParam Map<String,String> allParams) {
Map<String, Object> result = new HashMap<>();

if (badParams(allParams)) {
if (hasBadParams(allParams)) {
result.put("error", "Request must include ids and view settings");
return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST);
}
Expand Down Expand Up @@ -128,13 +128,13 @@ private String getValue(Resource resource, Property property) {
}

private ViewSettingRequest buildRequest(String id, ViewSettingRequest.ViewBehavior viewBehavior) {
var request = new ViewSettingRequest();;
var request = new ViewSettingRequest();
request.setObjectPidString(id);
request.setViewBehavior(viewBehavior);
return request;
}

private boolean badParams(Map<String,String> params) {
private boolean hasBadParams(Map<String,String> params) {
return params.isEmpty() || StringUtils.isBlank(params.get("targets"));
}
}

0 comments on commit ec0aeda

Please sign in to comment.