Skip to content

Commit

Permalink
[add] team id parameter를 get_match에 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Hwang-Jaeryeong committed Jan 23, 2024
1 parent 1f9275e commit 0701c1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Binary file modified info/__pycache__/views.cpython-311.pyc
Binary file not shown.
9 changes: 8 additions & 1 deletion info/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,18 @@ def get_top_scorers(request):

def get_match(request):
url = 'https://api-football-v1.p.rapidapi.com/v3/fixtures'
team_value = request.GET.get('team', None)

# params 딕셔너리 초기화
params = {
'league': '39',
'season': '2023',
'next': '3',
'next': '3'
}

# team_value가 None이 아닌 경우 params에 추가
if team_value is not None:
params['team'] = team_value
headers = {
'X-RapidAPI-Key': '24d52a531dmsh693cfe90d613d38p1a8e61jsn6a752b08adf5',
'X-RapidAPI-Host': 'api-football-v1.p.rapidapi.com',
Expand Down

0 comments on commit 0701c1b

Please sign in to comment.