Fixed a bug where a series with a relationship couldn't be deleted. (#1495)
This commit is contained in:
parent
9ee5ab97ef
commit
52ed5724e0
2 changed files with 4 additions and 1 deletions
|
@ -72,7 +72,9 @@ namespace API.Data
|
|||
builder.Entity<SeriesRelation>()
|
||||
.HasOne(pt => pt.TargetSeries)
|
||||
.WithMany(t => t.RelationOf)
|
||||
.HasForeignKey(pt => pt.TargetSeriesId);
|
||||
.HasForeignKey(pt => pt.TargetSeriesId)
|
||||
.OnDelete(DeleteBehavior.ClientCascade);
|
||||
|
||||
|
||||
builder.Entity<AppUserPreferences>()
|
||||
.Property(b => b.BookThemeName)
|
||||
|
|
|
@ -484,6 +484,7 @@ public class SeriesRepository : ISeriesRepository
|
|||
.Include(s => s.Volumes)
|
||||
.Include(s => s.Metadata)
|
||||
.ThenInclude(m => m.CollectionTags)
|
||||
.Include(s => s.Relations)
|
||||
.Where(s => seriesIds.Contains(s.Id))
|
||||
.AsSplitQuery()
|
||||
.ToListAsync();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue