|
@@ -57,13 +57,13 @@ public class GradeController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PatchMapping(value = "/edit/{id}")
|
|
@PatchMapping(value = "/edit/{id}")
|
|
|
- public ResponseEntity<Grade> editGrade(@PathVariable("id") long id, @RequestBody java.util.Map<String, Integer> body){
|
|
|
|
|
|
|
+ public ResponseEntity<Grade> editGrade(@PathVariable("id") long id, @RequestBody java.util.Map<String, Double> body){
|
|
|
try {
|
|
try {
|
|
|
Grade currentGrade = gradeRepository.findById(id);
|
|
Grade currentGrade = gradeRepository.findById(id);
|
|
|
if (currentGrade == null){
|
|
if (currentGrade == null){
|
|
|
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
|
}
|
|
}
|
|
|
- Integer grade = body.get("grade");
|
|
|
|
|
|
|
+ Double grade = body.get("grade");
|
|
|
if (grade == null) {
|
|
if (grade == null) {
|
|
|
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
|
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
|
|
}
|
|
}
|