Skip to content

Commit ab30ad2

Browse files
committed
Fix category post count includes drafts
1 parent 96e3f9e commit ab30ad2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Core/Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.2</TargetFramework>
5-
<Version>2.4.1.6</Version>
5+
<Version>2.4.1.7</Version>
66
</PropertyGroup>
77

88
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

src/Core/Data/Repositories/PostRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public async Task<IEnumerable<CategoryItem>> Categories()
229229

230230
if (_db.BlogPosts.Any())
231231
{
232-
foreach (var p in _db.BlogPosts.Where(p => p.Categories != null))
232+
foreach (var p in _db.BlogPosts.Where(p => p.Categories != null && p.Published > DateTime.MinValue))
233233
{
234234
var postcats = p.Categories.Split(',');
235235
if (postcats.Any())

0 commit comments

Comments
 (0)