-
Notifications
You must be signed in to change notification settings - Fork 437
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
Implements useQuery
& request
data fetching utilities (used in Location Management page)
#6269
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
useQuery
data fetching hook and request
utility (used in Location Management page)useQuery
& request
data fetching utilities (used in Location Management page)
Passing run #1246 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
@rithviknishad We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌. |
WHAT
🤖 Generated by Copilot at b035fd4
This pull request adds new types, functions, and components to improve the fetching and rendering of paginated data from the API. It introduces a
request
function and auseQuery
hook for performing generic fetch requests, and aPaginatedList
component for displaying paginated lists of data. It also adds aTRes
property to the route objects to specify the expected response types, and refactors theLocationManagement
component to use the new features. It also modifies some existing files to export and import the new types and components.Proposed Changes
useQuery
to perform GET operations on-mount.request
utility to perform any HTTP request.PaginatedList
component to articulate paginated queries and list items and handle state management for pagination (along with filters)Example usage:
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
🤖 Generated by Copilot at b035fd4
CommonButtonProps
type from theButtonV2.tsx
file for theRefresh
component (link)LocationManagement.tsx
file by using thePaginatedList
component instead of the custom logic and components for fetching and rendering the locations data (link)TRes
to each route object in theapi.tsx
file to specify the expected response type of the route (link)TRes
property to thelistFacilityAssetLocation
route object with thePaginatedResponse<LocationModel>
type (link)as const
assertion to theroutes
object, which makes the object and its properties readonly and prevents accidental mutations (link)request
that performs a generic fetch request to an API route with the given options (link)types.ts
file (link)useQuery
that is a custom hook for fetching data from an API route with the given options (link)utils.ts
file (link)LocationManagement
component instead of the named export in theAppRouter.tsx
file, since the component file was changed to use the default export syntax (link)PaginatedResponse
that defines the expected response type for paginated queries in theusePaginatedQuery.ts
file (link)