-
Notifications
You must be signed in to change notification settings - Fork 5
Pagination and search in student list in admin portal #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
* 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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this to 50
There was a problem hiding this comment.
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")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.DefaultQuery()?
There was a problem hiding this comment.
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
…used rollNoBounds utility file
No description provided.