Skip to content

Commit

Permalink
Alterações back de favoritar e add video para ver mais tarde
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedro0803 committed Aug 6, 2024
1 parent ba8161b commit 06c5b24
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/controller/savedVideosController.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@ def add_to_watch_later(watch_later: savedVideosSchema.WatchLaterCreate, db: Sess

@WatchLater.delete("/{video_id}")
def remove_from_watch_later(video_id: str, user_id: str = Query(...), db: Session = Depends(get_db)):
print(f"Attempting to remove video_id={video_id} for user_id={user_id}")
user_id = user_id.strip() # Certifique-se de que o `user_id` não contém espaços ou quebras de linha
video_id = video_id.strip() # Certifique-se de que o `video_id` não contém espaços ou quebras de linha
user_id = user_id.strip()
video_id = video_id.strip()
savedVideosRepository.remove_watch_later(db=db, video_id=video_id, user_id=user_id)
return {"message": "Removed from watch later list"}


@WatchLater.get("/status/{video_id}")
def check_watch_later(video_id: str, user_id: str = Query(...), db: Session = Depends(get_db)):
print(f"Checking watch later status for video_id={video_id}, user_id={user_id}")
status = savedVideosRepository.check_watch_later_status(db=db, video_id=video_id, user_id=user_id)
print(f"Status for video_id={video_id}, user_id={user_id} is {status}")
return {"status": status}

# início das requisições do favorite
Expand Down

0 comments on commit 06c5b24

Please sign in to comment.