-
Notifications
You must be signed in to change notification settings - Fork 902
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
feat: Add Server-side pagination to Surveys List #2197
feat: Add Server-side pagination to Surveys List #2197
Conversation
@gupta-piyush19 is attempting to deploy a commit to the formbricks Team on Vercel. A member of the Team first needs to authorize it. |
Thank you for following the naming conventions for pull request titles! 🙏 |
…piyush/for-1979-add-server-side-pagination-to-surveys-list
…piyush/for-1979-add-server-side-pagination-to-surveys-list
packages/lib/survey/service.ts
Outdated
@@ -320,6 +330,37 @@ export const getSurveys = async (environmentId: string, page?: number): Promise< | |||
return surveys.map((survey) => formatDateFields(survey, ZSurvey)); | |||
}; | |||
|
|||
export const getSurveyCountByEnvironmentId = async (environmentId: string): Promise<number> => { |
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.
We have an implicit convention where you don't need the ByEnvironmentId
(or similar) if it's the default parent of the object (so that we get simple getSurveys
or other functions). So in this case ByEnvironmentId
is not needed.
…piyush/for-1979-add-server-side-pagination-to-surveys-list
…piyush/for-1979-add-server-side-pagination-to-surveys-list
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.
@gupta-piyush19 thanks for making the changes :-) Works great! 👍💪🚀
@gupta-piyush19 Can you please check on the failing tests? |
…piyush/for-1979-add-server-side-pagination-to-surveys-list
…ist' of https://github.com/gupta-piyush19/formbricks into piyush/for-1979-add-server-side-pagination-to-surveys-list
…piyush/for-1979-add-server-side-pagination-to-surveys-list
What does this PR do?
Adds Server-side pagination to Surveys List
Fixes https://linear.app/formbricks/issue/FOR-1979/add-server-side-pagination-to-surveys-list
Checklist
Required
pnpm build
console.logs
git pull origin main
Appreciated