CougarCS / CougarCS-AdminPortal

Our officer admin portal created with React & Typescript
MIT License
6 stars 12 forks source link

Search Sort Paginate #55

Closed seesjays closed 1 year ago

seesjays commented 1 year ago

One of the final things we need for the members page is the feature to search, sort, and paginate the data. I've implemented most of the UI and stuff on the Members page, we just need you to implement the logic that actually does the work. I've described the logic in the /util/searchSortPaginate.ts file, but here it is repeated:

1. use fuzzy search across all elements of each member
    you can probably do this really easily by concatenating
    the values into a string and then using indexOf
    2. sort the elements that made it through
    3. paginate by putting elements in arrays of length N (array.splice)

    return an array of those paginated arrays

The reason we're returning an array of arrays is so we can just index them and get the different pages that way instead of having to do all the work to paginate/cache/manage the data from Supabase.

seesjays commented 1 year ago

I did some further consideration and it'd probably be better to use array.slice instead of array.splice.