Skip to content

Conversation

@saumyarr8
Copy link
Contributor

No description provided.

saumyarr8 and others added 4 commits April 5, 2025 00:05
* add timestamps for student records during assignment and registration

* update student model to set UpdatedAt field to current UTC time

Co-authored-by: Vyas Giri <vyas.giri.cer22@itbhu.ac.in>
* implement pagination for GetAllCompanies endpoint

* Implement pagination and search functionality in GetAllStudents endpoint
* implement pagination for GetAllCompanies endpoint

* Added error handling for pagination

* Implement pagination and search functionality in GetAllStudents endpoint

* Add search functionality to GetAllStudents endpoint with roll number support
search := ctx.Query("search")

currentPageStr := ctx.DefaultQuery("page", "0")
studentsPerPageStr := ctx.DefaultQuery("limit", "0")
Copy link
Member

Choose a reason for hiding this comment

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

change this to 50

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be better if the value 50 is handled in the frontend, if some issue is there from the frontend in sending the params, then it defaults to 0 and returns all the students.

currentPage := 0

companies, err := controller.GetAllCompanies(h.MongikClient, noCache)
currentPage, err := strconv.Atoi(ctx.Request.URL.Query().Get("page"))
Copy link
Member

Choose a reason for hiding this comment

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

ctx.DefaultQuery()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will refactor the companies pagination in another pr. Currently it works as expected.

… and extract roll number bounds into a separate utility function
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