From 7204924cab18a04ac41d7e6d2200e95595e1bce9 Mon Sep 17 00:00:00 2001 From: jkissane2 Date: Thu, 2 Apr 2026 10:42:23 -0400 Subject: [PATCH] Finished Banjo App I am proud of my project. I actually just went back in and reorganized the endpoints and added a new one named "course". I did this becuase I will be teaching more than one course in the future and I want to be able to easily add whatever courses I teach to the app. I also reorganized the endpoints so that they are in a more logical order starting with the broadest category (course) and then going to the more specific categories as you go down the list. I definitely learned a lot of new skills skills along the way and I am excited to keep building on this project in the future. --- lesson_app/app/views.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lesson_app/app/views.py b/lesson_app/app/views.py index 6b7fff5..c3646d7 100644 --- a/lesson_app/app/views.py +++ b/lesson_app/app/views.py @@ -39,9 +39,10 @@ lessons_data = [ } ] -@route_get("lessons") -def lessons(params): - return {"lessons": lessons_data} +@route_get("course") +def course(params): + course_name = sorted(set(lesson["course"] for lesson in lessons_data)) + return {"course": course_name} @route_get("units") def units(params): @@ -53,6 +54,10 @@ def topics(params): topic_names = sorted(set(lesson["topic"] for lesson in lessons_data)) return {"topics": topic_names} +@route_get("lessons") +def lessons(params): + return {"lessons": lessons_data} + @route_get("notes") def notes(params): notes_names = sorted(set(lesson["notes"] for lesson in lessons_data))