Skip to content

Commit

Permalink
Altera get record
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeJRdev committed Aug 18, 2024
1 parent 6671ff4 commit 36710e4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 288 deletions.
9 changes: 5 additions & 4 deletions src/controller/recordController.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def add_to_record(record: recordSchema.RecordCreate, db: Session = Depends(get_d
return new_record

@Record.get("/get_record")
def check_record(user_id: str =Query(...) , db: Session = Depends(get_db)):
record = recordSchema.RecordGet(user_id =user_id)
videos = recordRepository.get_record(db=db, record=record)
return {"videos": videos}
def check_record(user_id: str = Query(...), db: Session = Depends(get_db)):
record = db.query(recordModel.Record).filter(recordModel.Record.user_id == user_id).first()
if record:
return {"videos": record.videos}
return {"videos": {}} # Retorna um dicionário vazio se não houver registro
Loading

0 comments on commit 36710e4

Please sign in to comment.