PAN-52 Fixed issue with the Theorems API
This commit is contained in:
+10
-1
@@ -107,13 +107,20 @@ public class TheoremController {
|
||||
|
||||
@GetMapping("/name")
|
||||
public @ResponseBody
|
||||
ResponseEntity<List<Theorem>> getAllTheoremsByName(@RequestParam("name") final String name) {
|
||||
ResponseEntity<List<Theorem>> getAllTheoremsByName(@RequestParam("name") String name) {
|
||||
LOG.info("Received request to query for theorems whose name is {}", name);
|
||||
if (name == null) {
|
||||
LOG.error("ERROR: name was null");
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
name = name.toLowerCase();
|
||||
|
||||
if (name.contains("_") || name.contains("-")) {
|
||||
name = name.replace("-", "\\s");
|
||||
name = name.replace("-", "\\s");
|
||||
}
|
||||
|
||||
LOG.debug("Querying for theorems with name {}", name);
|
||||
|
||||
final StopWatch stopWatch = new StopWatch();
|
||||
@@ -181,6 +188,8 @@ public class TheoremController {
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
theorem.setName(theorem.getName().toLowerCase());
|
||||
|
||||
LOG.debug("Saving new theorem");
|
||||
|
||||
final StopWatch stopWatch = new StopWatch();
|
||||
|
||||
Reference in New Issue
Block a user