From 2195dac8a1e37fcaf818b150fe4d74b2efc7e2b4 Mon Sep 17 00:00:00 2001 From: jc <46619361+juancwu@users.noreply.github.com> Date: Sun, 24 Nov 2024 11:08:08 -0500 Subject: [PATCH] route to get notes --- backend/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/main.py b/backend/main.py index b425b15..5e30217 100644 --- a/backend/main.py +++ b/backend/main.py @@ -977,6 +977,11 @@ async def enroll_in_course( return {"message": "Successfully enrolled 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 } + @app.post("/quizzes/{quiz_id}/review/feedback") async def submit_review_feedback( quiz_id: int,