-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor StudentTable component and userController
This commit refactors the StudentTable component by removing the unnecessary useEffect hook and splitting the fetchData function into fetchStudentData and fetchCompaniesData. It also updates the fetchStudentData function to sort the students by rollNo and sets the students state accordingly. The fetchCompaniesData function fetches the companies and sets the companies state. In the userController, the updateCompany function is updated to handle the case when the companyId is 'np' (Not Placed). It sets the placedAt object accordingly and updates the selectedStudentsRollNo array in the company if necessary.
- Loading branch information
1 parent
801c220
commit 7ebfa58
Showing
2 changed files
with
54 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters