UoaWDCC / uasc-web

Project with the University of Auckland Snowsports Club Website & Booking System. Established in 2023.
https://uasc.co.nz
6 stars 2 forks source link

[FRONTEND] Add CSV export feature to the admin member view #469

Closed bcho892 closed 3 months ago

bcho892 commented 4 months ago

Is your feature request related to a problem? Please describe.

Using the data fetched in the useAllUserDataQuery there should be a way to serialise and convert all of the data to a csv format.

You may want to add a new dependency i.e https://www.npmjs.com/package/json-2-csv or https://www.npmjs.com/package/react-csv

OR you can attempt to hand roll a solution

Note that the flow of this feature should be:

  1. Wait for all users to be fetched
  2. Serialize the data to a CSV format
  3. Create download for user

You will need to understand pagination (https://tanstack.com/query/v4/docs/framework/react/guides/infinite-queries) may be useful. Check the usage in ProtectedAdminMemberView

You should wait until there is no hasNextPage before allowing the export button to be clicked.

BEFORE MERGING