Skip to content

Commit

Permalink
fix route
Browse files Browse the repository at this point in the history
  • Loading branch information
juancwu committed Nov 24, 2024
1 parent 796a6d6 commit 6e9652d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,12 @@ async def enroll_in_course(

@app.get("/course/{course_id}/notes")
async def get_notes_progress(course_id: int, current_user: User = Depends(get_current_user), db: Session = Depends(get_db)):
items = db.query(models.Page).filter(models.Page.course_id == course_id).join(models.Note.student_id == current_user.id and models.Page.course_id == course_id).all()
return { "items": items }
pages = db.query(models.Page).filter(models.Page.course_id == course_id).all()
notes = []
for page in pages:
note = db.query(models.Note).filter(models.Note.student_id == current_user.id and models.Note.page_id == page.id).first()
notes.append(note)
return { "notes": notes }

@app.post("/quizzes/{quiz_id}/review/feedback")
async def submit_review_feedback(
Expand Down

0 comments on commit 6e9652d

Please sign in to comment.