Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Jul 13, 2024
1 parent cd3c4cb commit 8ae1c09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ func (c *Client) GetSeriesDetails(id int) *SeriesDetails {
}

func (c *Client) DeleteSeries(id int) error {
_, err := c.ent.Series.Delete().Where(series.ID(id)).Exec(context.TODO())
_, err := c.ent.Episode.Delete().Where(episode.SeriesID(id)).Exec(context.TODO())
if err != nil {
return err
}
_, err = c.ent.Episode.Delete().Where(episode.SeriesID(id)).Exec(context.TODO())
_, err = c.ent.Series.Delete().Where(series.ID(id)).Exec(context.TODO())
return err
}

Expand Down

0 comments on commit 8ae1c09

Please sign in to comment.