Fix to allow scene to be removed when attached to a movie (#421)

This commit is contained in:
Anon247
2020-04-01 02:07:43 +01:00
committed by GitHub
parent 2a8e5d5b9b
commit 0bbb2bd1d0

View File

@@ -138,6 +138,10 @@ func (qb *SceneQueryBuilder) ResetOCounter(id int, tx *sqlx.Tx) (int, error) {
}
func (qb *SceneQueryBuilder) Destroy(id string, tx *sqlx.Tx) error {
_, err := tx.Exec("DELETE FROM movies_scenes WHERE scene_id = ?", id)
if err != nil {
return err
}
return executeDeleteQuery("scenes", id, tx)
}
func (qb *SceneQueryBuilder) Find(id int) (*Scene, error) {