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 - lesson_id, course_id, title, content
create a function createLesson that creates a new
This function will accept the request object and every rows must be
Present else return the missing object with status code 400. if the course_id does not signify any course return 404 with error course not found. If everything is okay, Create the new lesson with new id(lesson_id) and return status code 201 with new object created.
create a function getLessons that get all Lessons in the database. return status code 200 with all the Lessons.
create a function getLesson that get a Lesson with a particular ID. The ID will be part of the url(params). If Lesson not found return 404 with error Lesson not found. If okay, return the Lesson with 200 statuscode
create a function updateLesson that get a Lesson with a particular ID. The ID will be part of the url(params). If Lesson not found return 404 with error Lesson not found. If found take the request object and update it accordingly and return the new record with status code 200
create a function deleteLesson that get a user with a particular ID. The ID will be part of the url(params). If Lesson not found return 404 with error Lesson not found. Then delete this Lesson and return 200 with details of Lesson deleted
POST - createLesson, updateLesson
GET - getLessons, getLesson , deleteLesson
Import this into and include the routes in routes/lesson.js then include it in sever.js.
Test everything if possible.(Optional: Write an automated testing for testing each endpoints in lesson_test.py/.js)
The text was updated successfully, but these errors were encountered:
create lesson controller
The file should be under controller/lesson.js
The schema contain - lesson_id, course_id, title, content
create a function createLesson that creates a new
This function will accept the request object and every rows must be
Present else return the missing object with status code 400. if the course_id does not signify any course return 404 with error course not found. If everything is okay, Create the new lesson with new id(lesson_id) and return status code 201 with new object created.
create a function getLessons that get all Lessons in the database. return status code 200 with all the Lessons.
create a function getLesson that get a Lesson with a particular ID. The ID will be part of the url(params). If Lesson not found return 404 with error Lesson not found. If okay, return the Lesson with 200 statuscode
create a function updateLesson that get a Lesson with a particular ID. The ID will be part of the url(params). If Lesson not found return 404 with error Lesson not found. If found take the request object and update it accordingly and return the new record with status code 200
create a function deleteLesson that get a user with a particular ID. The ID will be part of the url(params). If Lesson not found return 404 with error Lesson not found. Then delete this Lesson and return 200 with details of Lesson deleted
POST - createLesson, updateLesson
GET - getLessons, getLesson , deleteLesson
routes
/lessons -> creatLesson, getLesson
/lessonss/:lesson_id -> getLesson, deleteLesson, updateLesson
Import this into and include the routes in routes/lesson.js then include it in sever.js.
Test everything if possible.(Optional: Write an automated testing for testing each endpoints in lesson_test.py/.js)
The text was updated successfully, but these errors were encountered: