Commit 73f4f4e1 authored by Shanelle Valencia's avatar Shanelle Valencia

Add update method

parent 83fc091d
com/StudentServices/MarksService/exception/ResourceNotFoundException.java
com.StudentServices.MarksService.exception.ResourceNotFoundException
com/StudentServices/MarksService/exception/ErrorDetails.java
com.StudentServices.MarksService.exception.ErrorDetails
com/StudentServices/MarksService/MarksServiceApplication.java
com.StudentServices.MarksService.MarksServiceApplication
com/StudentServices/MarksService/repository/StudentRepository.java
com.StudentServices.MarksService.repository.StudentRepository
com/StudentServices/MarksService/model/StudentMarks.java
com.StudentServices.MarksService.model.StudentMarks
com/StudentServices/MarksService/exception/GlobalExceptionHandler.java
com.StudentServices.MarksService.exception.GlobalExceptionHandler
com/StudentServices/MarksService/service/StudentService.java
com.StudentServices.MarksService.service.StudentService
com/StudentServices/MarksService/controller/StudentMarksController.java
com.StudentServices.MarksService.controller.StudentMarksController
......@@ -69,13 +69,14 @@ public class StudentMarksController {
// @PutMapping("/studentMarks/update/{emailAddress}")
// public ResponseEntity<StudentMarks> updateStudentMarks(@PathVariable (value= "emailAddress") String emailAddressId) throws ConfigDataResourceNotFoundException {
// StudentMarks studentMarks = studentService.getStudentById(emailAddressId);
//
// final StudentMarks updatedStudentMarks = studentService.editStudentMarks(studentMarks);
// return ResponseEntity.ok(updatedStudentMarks);
// }
@PutMapping("/studentMarks/update/{emailAddress}")
public ResponseEntity<StudentMarks> updateStudentMarks(@PathVariable (value= "emailAddress") String emailAddressId) throws ResourceNotFoundException {
StudentMarks studentMarks = studentService.getStudentById(emailAddressId)
.orElseThrow(() -> new ResourceNotFoundException("Employee not found for this id :: " + emailAddressId));
final StudentMarks updatedStudentMarks = studentService.editStudentMarks(studentMarks);
return ResponseEntity.ok(updatedStudentMarks);
}
......
......@@ -34,9 +34,6 @@ public class StudentService {
}
public void updateStudent(StudentMarks studentMarks) {}
public StudentMarks editStudentMarks(StudentMarks studentMarks) {
studentMarks.setMarks(studentMarks.getMarks());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment