-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added lecture to specific playlist #68
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
take just title and description from req.body and id from req.params
Hi, I am sorry I had a confusion in route which I mentioned in issue Take the route as /course/:id Also add isAuthenticated and adminAuthorise middlewares, so that only admin has power to add lectures in course |
@anand-harsh i have made the changes .. kindly have a look at it |
Hi @Anushkabh , have you tested this api on your local? |
|
yes , but without using admin middleware |
send me screenshot of the request and response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go to models > Courses.js, comment out the required:true in lectures > video >public_id and url
Hi @Anushkabh , your code works fine for all cases and admin auth too, just make the suggested changes and will be ready to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM💥💥
Have you read the Contributing Guidelines?
yes
Issue #41
Describe your changes
Created a controller for adding lectures to playlist.
It first validates the existence of the specified course by its ID.
If the course exists, it checks if the lecture with the provided title already exists in the course. If so, it returns an error.
If the lecture is unique, it adds the lecture details (title, description, video public ID, and URL) to the course's lectures array.
Clearly and concisely describe what's in this pull request. Include screenshots, if necessary.