Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Conversation

SashaMalysehko
Copy link

Problem

The getRecordsForGroup function in src/utils/records.ts lacks pagination and sorting capabilities, as indicated by two TODO comments:

  • "todo: add pagination support here"
  • "todo: add the ability to auto sort based on a given field"

This makes it difficult to handle large sets of records efficiently and organize them in a meaningful way.

Summary of Changes

  • Added pagination support with page and pageSize parameters
  • Implemented sorting functionality with sortField and sortDirection options
  • Added pagination metadata including:
    • Total records count
    • Total pages
    • Current page
    • Next/previous page indicators
  • Added TypeScript interfaces for better type safety:
    • PaginationMetadata
    • PaginatedResponse
  • Maintained backward compatibility with existing code
  • Added proper type annotations to fix TypeScript linting issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant