You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The schema contain - course_id, title, description, user_id(instructor)
create a function createCourss that creates a new course
This function will accept the request object. The title and user_id must be present. If user_id not a user return 404 with error no user found else return the missing object with status code 400. If everything is okay, Create the new course with new id(course_id) and return status code 201 with new object created.
create a function getCourses that get all courses in the database. return status code 200 with all the courses.
create a function getCourse that get a course with a particular ID. The ID will be part of the url(params). If course not found return 404 with error course not found. If okay, return the course with 200 statuscode
create a function UpdateCourse that update a course with a particular ID. The ID will be part of the url(params). If course not found return 404 with error course not found. If found take the request object and update it accordingly and return the new record with status code 200
create a function deleteCourse that get a course with a particular ID. The ID will be part of the url(Paramus). If course not found return 404 with error course not found. IF okay Then delete this course and return 200 with details of course deleted
POST - createCourse, updateCourse
GET - getCourses, getCourse, deleteCourse
Import this into and create the routes in routes/course.js then include it in server.js. Test everything if possible. Write an automated testing for testing each endpoints in course_test.py/.js
The text was updated successfully, but these errors were encountered:
create course controller
The file should be under controller/course.js
The schema contain - course_id, title, description, user_id(instructor)
create a function createCourss that creates a new course
This function will accept the request object. The title and user_id must be present. If user_id not a user return 404 with error no user found else return the missing object with status code 400. If everything is okay, Create the new course with new id(course_id) and return status code 201 with new object created.
create a function getCourses that get all courses in the database. return status code 200 with all the courses.
create a function getCourse that get a course with a particular ID. The ID will be part of the url(params). If course not found return 404 with error course not found. If okay, return the course with 200 statuscode
create a function UpdateCourse that update a course with a particular ID. The ID will be part of the url(params). If course not found return 404 with error course not found. If found take the request object and update it accordingly and return the new record with status code 200
create a function deleteCourse that get a course with a particular ID. The ID will be part of the url(Paramus). If course not found return 404 with error course not found. IF okay Then delete this course and return 200 with details of course deleted
POST - createCourse, updateCourse
GET - getCourses, getCourse, deleteCourse
routes
/courses - createCourse, getCourses
/courses/:course_id - getCourse, deleteCourse, updateCourse
Import this into and create the routes in routes/course.js then include it in server.js. Test everything if possible. Write an automated testing for testing each endpoints in course_test.py/.js
The text was updated successfully, but these errors were encountered: