fixed Newsletter Page displaying distribution for deleted articles
This commit is contained in:
parent
8d0a21c833
commit
791a11d053
|
@ -67,7 +67,6 @@
|
|||
await using var context = await ContextFactory.CreateDbContextAsync();
|
||||
|
||||
Newsletters = await context.Set<EmailNewsletter>()
|
||||
.IgnoreQueryFilters().IgnoreAutoIncludes()
|
||||
.Include(n => n.Article)
|
||||
.OrderByDescending(n => n.DistributionDateTime)
|
||||
.ToListAsync();
|
||||
|
|
|
@ -95,6 +95,7 @@ public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options
|
|||
newsletter.Property(a => a.DistributionDateTime)
|
||||
.HasConversion(dateTimeOffsetUtcConverter);
|
||||
|
||||
newsletter.HasQueryFilter(n => !n.Article.IsDeleted);
|
||||
newsletter.ToTable("Newsletter");
|
||||
});
|
||||
builder.Entity<EmailSubscriber>(subscriber => {
|
||||
|
|
Loading…
Reference in a new issue