This commit is contained in:
Krystian Wasilewski 2023-01-13 17:55:18 +01:00
parent d36ea7a62d
commit 150916879f

View File

@ -69,10 +69,10 @@ async def startup_event():
@app.get('/find/{title}') @app.get('/find/{title}')
def titles(title: str): def titles(title: str):
response = {} response = []
for index, row in data.iterrows(): for index, row in data.iterrows():
if title.lower() in row['title'].lower(): if title.lower() in row['title'].lower():
response[index] = {'title': row['title'], 'year': row['release_year']} response.append({'id': index, 'title': row['title'], 'year': row['release_year']})
return response return response