[x] Backend: Connect the new users generated after they sign up to the database (5/26)
@PostMapping("/post")
public ResponseEntity<Object> postPerson(@RequestBody PersonRequest personRequest) {
// A person object WITHOUT ID will create a new record with default roles as
// student
Person person = new Person(personRequest.getEmail(), personRequest.getPassword(), personRequest.getName(),
personRequest.getUsn(), personRequest.getSubjectsOfInterest());
personDetailsService.save(person);
return new ResponseEntity<>(personRequest.getEmail() + " is created successfully", HttpStatus.CREATED);
}
[x] Backend: Implement searching into the class creation feature based on subjects. (5/27)
Uses a SQL query to get the subjects of interest
// List<Person> findBySubjectsOfInterestContainingIgnoreCase(String subjectOfInterest);
// CUSTOM QUERY METHOD TO GET A SUBJECT OF INTEREST
@Query("SELECT p FROM Person p JOIN p.subjectsOfInterest s WHERE LOWER(s) = LOWER(:subjectOfInterest)")
List<Person> findBySubjectOfInterestIgnoreCase(@Param("subjectOfInterest") String subjectOfInterest);
@GetMapping("/getBySubject/{subjectOfInterest}")
public ResponseEntity<?> getPersonsBySubject(@PathVariable String subjectOfInterest) {
List personList = personDetailsService.getPersonsBySubjectOfInterest(subjectOfInterest);
// regardless of outcome, even if it's an empty list, it's still a valid output
return new ResponseEntity<>(personList, HttpStatus.OK);
}
## Undo and Redo Stacks and Queues:
![image](https://github.com/John-sCC/jcc_frontend/assets/75040379/ff753bca-577c-48f4-9cd5-f37ee87c2215)
![image](https://github.com/John-sCC/jcc_frontend/assets/75040379/bd141bc4-f590-44d5-8ba0-c2d516bf26e9)
- I tried to use backend for this method, but it didn't work out well so I have frontend
My Demonstration for my features
Links: Sign Up Class Creation Feature
My checklist:
@GetMapping("/getBySubject/{subjectOfInterest}") public ResponseEntity<?> getPersonsBySubject(@PathVariable String subjectOfInterest) { List personList = personDetailsService.getPersonsBySubjectOfInterest(subjectOfInterest);
// regardless of outcome, even if it's an empty list, it's still a valid output
return new ResponseEntity<>(personList, HttpStatus.OK);
}