-
Notifications
You must be signed in to change notification settings - Fork 8
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
lesson edit and delete #335
base: main
Are you sure you want to change the base?
Conversation
const lesson = await db.Lesson.destroy({ where: { id } }) | ||
const lesson = await db.Lesson.destroy({ | ||
where: { id }, | ||
include: [db.Video, db.Photo, db.Text, db.Material] |
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.
delete test as well
if (req.file) { | ||
lessonImg = req.file.filename | ||
} | ||
const photo = await db.Photo.update( |
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.
if no image is choosed it cause error
@@ -38,10 +38,10 @@ module.exports = (sequelize, DataTypes) => { | |||
Lesson.hasOne(models.Test, { |
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.
do cascade delete for this as well
Fixes #issue_number
Description
Description of changes made.
Screenshots
Links and Curls