Skip to content

Commit

Permalink
level's value condition corrected - fixed the condition order
Browse files Browse the repository at this point in the history
  • Loading branch information
waterflow80 committed Aug 17, 2023
1 parent 4cd8c7f commit 26ea8b5
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ public SeqColController(SeqColService seqColService) {
@GetMapping(value = "/{digest}")
public ResponseEntity<?> getSeqColByDigestAndLevel(
@PathVariable String digest, @RequestParam(required = false) String level) {
if (!level.equals("1") && !level.equals("2")) {
if (level == null) {
level = "none";
}else if (!level.equals("1") && !level.equals("2")) {
// Not a valid level value
return new ResponseEntity<>("Level should be either 1 or 2", HttpStatus.BAD_REQUEST);
}
try {
if (level == null) {
level = "none";
}
switch (level) {
case "1":
case "none":
Expand Down

0 comments on commit 26ea8b5

Please sign in to comment.