Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughAdds an admin-only GET endpoint to list published courses with filtering and sorting, computing derived stats per course. Renames the unPublishLesson handler to unpublishLesson across controller and routes. Updates routing to include the new admin endpoint with auth middlewares and Swagger docs. Changes
Sequence Diagram(s)sequenceDiagram
actor Admin
participant Route as /api/courses
participant MW as Auth Middlewares
participant Ctrl as getPublishedCoursesForAdmin
participant CourseModel
participant LessonModel
participant Res as Response
Admin->>Route: GET /admin/published?search&level&sortBy&sortOrder
Route->>MW: updateAccessToken → isAuthenticated → authorizeRoles('admin')
MW-->>Route: authorized
Route->>Ctrl: invoke handler
Ctrl->>CourseModel: find published courses + populate (author, category, subCategory, level)
loop For each course
Ctrl->>LessonModel: countDocuments by course sections
LessonModel-->>Ctrl: lessonsCount
end
Ctrl-->>Res: { success: true, data, totalCourses }
Res-->>Admin: 200 OK JSON
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit