Compare commits
2 Commits
9991ecf173
...
cf4d92c035
Author | SHA1 | Date | |
---|---|---|---|
cf4d92c035 | |||
58797b82ca |
@ -9,7 +9,7 @@
|
||||
@await Html.PartialAsync("Partials/_MastodonStatus")
|
||||
|
||||
<div id="all-blog-posts">
|
||||
@foreach (IBlogPost post in BlogPostService.GetBlogPosts(Model.PageNumber))
|
||||
@foreach (IBlogPost post in BlogPostService.GetBlogPosts(Model.PageNumber - 1))
|
||||
{
|
||||
@await Html.PartialAsync("Partials/_BlogCard", post)
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ internal sealed class BlogPostService : IBlogPostService
|
||||
{
|
||||
using BlogContext context = _dbContextFactory.CreateDbContext();
|
||||
return visibility == Visibility.None
|
||||
? context.BlogPosts.Count()
|
||||
: context.BlogPosts.Count(p => p.Visibility == visibility);
|
||||
? context.BlogPosts.Count(p => !p.IsRedirect)
|
||||
: context.BlogPosts.Count(p => !p.IsRedirect && p.Visibility == visibility);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
Loading…
Reference in New Issue
Block a user