Fix bug in naming
This commit is contained in:
@@ -91,13 +91,13 @@ async def get_random_unvoted_video(current_user: dict = Depends(is_user)):
|
||||
Retrieves a random, unvoted video document from Firestore.
|
||||
"""
|
||||
db = get_db()
|
||||
videos_stream = db.collection('videos').where('has_been_voted', '==', False).limit(1).stream()
|
||||
videos_stream = db.collection('videos').where('has_been_voted', '==', False).limit(5).stream()
|
||||
unvoted_videos = [doc.to_dict() for doc in videos_stream]
|
||||
|
||||
if not unvoted_videos:
|
||||
raise HTTPException(status_code=404, detail="No more videos to vote on!")
|
||||
|
||||
return Video(**random_video_data)
|
||||
return Video(**unvoted_videos)
|
||||
|
||||
|
||||
@router.post("/{video_id}/vote", status_code=status.HTTP_201_CREATED)
|
||||
|
||||
Reference in New Issue
Block a user