Skip to content

Finished project Yunis | Ayhan#74

Open
AyhanAghayev wants to merge 3 commits intoironhack-labs:mainfrom
YunisSadig:main
Open

Finished project Yunis | Ayhan#74
AyhanAghayev wants to merge 3 commits intoironhack-labs:mainfrom
YunisSadig:main

Conversation

@AyhanAghayev
Copy link
Copy Markdown

No description provided.

public void setStudentId(String courseId){
this.studentId=studentId;
}
public void setName(String studentId){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be String name rather then studentId?

public Course getCourse(){
return course;
}
public void setStudentId(String courseId){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be String studentId rather then courseId?

}

@PostMapping
public ResponseEntity<Student> createStudent(@RequestBody String name, String address, String email) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RequestBody like this won't work.
createStudent(@RequestBody Student student) is the proper way.
The same happens in update.

}

@GetMapping("/{courseId}/students")
public ResponseEntity<List<Student>>getEnrolledStudents(String courseId) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PathVariable is missing.

return ResponseEntity.ok(studentEnrolled);
}

@GetMapping("/{studentId}/course")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PathVariable is missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants