Implement data fetching logic for the "playerStats" component to retrieve and display individual player statistics from the API Gateway.
Tasks
Backend Verification
[x] Confirm the Lambda function is capable of querying the database for individual player statistics.
[x] Ensure the API Gateway endpoint for retrieving player statistics is properly configured and accessible.
Implement Route Handlers in Next.js
[x] Develop a new route handler for fetching individual player statistics from the API Gateway.
[x] Utilize axios within the route handler to perform HTTP GET requests to the API Gateway, targeting the endpoint designed to provide player statistics.
Server-side Data Fetching
[x] Use the created Route Handler to fetch data on the server side, initiating API calls with the player_id to retrieve their statistics.
[x] Implement error handling within the Route Handler to effectively manage scenarios where data fetching fails or returns no results.
Client-side Data Fetching and Integration
[x] On the client side, use the fetch API to retrieve data from the Route Handler, focusing on efficient data retrieval and modern web practices.
[x] Dynamically update the "playerStats" component with the fetched statistics, ensuring the component accurately reflects the player's performance data.
Objective
Implement data fetching logic for the "playerStats" component to retrieve and display individual player statistics from the API Gateway.
Tasks
Backend Verification
Implement Route Handlers in Next.js
axios
within the route handler to perform HTTP GET requests to the API Gateway, targeting the endpoint designed to provide player statistics.Server-side Data Fetching
player_id
to retrieve their statistics.Client-side Data Fetching and Integration
fetch
API to retrieve data from the Route Handler, focusing on efficient data retrieval and modern web practices.