Closed qczy closed 1 year ago
id refers to the match id, not the mongo _id which is associated with it try endpoint http://api.cup2022.ir/api/v1/match/1
it will give the following result
{ "status": "success", "data": [ { "_id": "629c9c8a5749c4077500ead4", "away_score": 0, "away_scorers": [ "null" ], "away_team_id": "4", "finished": "FALSE", "group": "A", "home_score": 0, "home_scorers": [ "null" ], "home_team_id": "3", "id": "1", "local_date": "11/21/2022 19:00", "matchday": "2", "persian_date": "1400-08-30 19:30", "stadium_id": "1", "time_elapsed": "h2", "type": "group", "home_team_fa": "سنگال", "away_team_fa": "هلند", "home_team_en": "Senegal", "away_team_en": "Nederlands", "home_flag": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Flag_of_Senegal.svg/125px-Flag_of_Senegal.svg.png", "away_flag": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Flag_of_the_Netherlands.svg/125px-Flag_of_the_Netherlands.svg.png" } ] }
@raminmr please look in the issue you can add a middleware to validate the id for the given endpoint Please let me know if I can help you with this. Cheers
Endpoint http://api.cup2022.ir/api/v1/match/629c9c8a5749c4077500ead4 gives reply:
{ "status": "error", "message": "Cannot read property 'home_team_id' of undefined" }