Skip to content
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

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open

lesson edit and delete #335

wants to merge 26 commits into from

Conversation

thepuskar
Copy link
Member

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 lmmrssa and dogi 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

@@ -38,10 +38,10 @@ module.exports = (sequelize, DataTypes) => {
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
3 participants