freshkitedev / Freshkite_Project

0 stars 6 forks source link

get specific course field #14

Closed Pycodeblast closed 1 week ago

Pycodeblast commented 1 week ago

This PR introduces a controller and service function to retrieve course details by ID with dynamic field selection. The key updates include:

Controller (getCourseById):

Accepts a dynamic query parameter fields to specify which course fields to retrieve. If no fields are specified, the title field is returned by default. Returns a 404 response if the course is not found. Handles errors by returning a 500 response with the error message. Service (getCourseDetailsById):

Fetches the course details from the database by ID and includes only the requested fields. The fields parameter is optional, and if provided, it splits the comma-separated string into individual field names for the query.

freshkitedev commented 1 week ago

Unwanted changes present.