Skip to content

Conversation

@thepuskar
Copy link
Contributor

Fixes #issue_number

Description

Description of changes made.

Screenshots

Links and Curls

@thepuskar thepuskar added the WIP label Jul 17, 2021
@thepuskar thepuskar requested review from dogi and lmmrssa July 17, 2021 13:31
@thepuskar thepuskar self-assigned this Jul 17, 2021
@thepuskar thepuskar linked an issue Jul 17, 2021 that may be closed by this pull request
@thepuskar thepuskar removed the WIP label Jul 29, 2021
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]
Copy link
Member

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(
Copy link
Member

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

)

Lesson.associate = (models) => {
Lesson.hasOne(models.Test, {
Copy link
Member

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

@lmmrssa lmmrssa added todo duplicate This issue or pull request already exists and removed todo labels Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lesson edit

4 participants