Currently, I am developing an app for the premier league that allows users to create their own teams, input scores for matches, and view updated team statistics in a sortable table based on the Premier League rules.
Issue:
I have encountered a problem with updating teams after each match. Whenever I quickly update multiple matches in succession by setting scores on the website, the HTTP PUT request that is responsible for updating the teams fails to work properly. Strangely enough, when I take my time to update matches individually, everything functions as expected.
Therefore, I am curious to understand why the HTTP PUT requests, essential for updating teams, do not function correctly when I update matches rapidly?
In this project, I am utilizing the Local JSON Server to store all data. Link to the project
match-item.component.ts
The Match Item Component includes functionality for handling individual match details such as setting scores, updating teams, and managing matchday information efficiently within the app.
league-matches.component.ts
The League Matches Component focuses on displaying and organizing matchdays along with their corresponding matches, facilitating seamless editing and event management functionalities for the users.
premier-league.service.ts
The Premier League Service file contains methods for fetching and updating team and matchday data using HTTP requests, ensuring smooth communication between the frontend app and the backend server.
interfaces
The interfaces define the structure of Team, Match, Matchday, and Club entities, specifying the attributes and relationships required for effective data management and processing in the application.