From 8ccf8100d46590f9c164949eb9f01183e7ebeb81 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 22 Nov 2025 17:50:19 +0800 Subject: [PATCH] :necktie: Make listing on the hosted page shows article only --- DysonNetwork.Zone/Pages/Posts.cshtml.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DysonNetwork.Zone/Pages/Posts.cshtml.cs b/DysonNetwork.Zone/Pages/Posts.cshtml.cs index 04603ba..9c64d6e 100644 --- a/DysonNetwork.Zone/Pages/Posts.cshtml.cs +++ b/DysonNetwork.Zone/Pages/Posts.cshtml.cs @@ -2,6 +2,7 @@ using DysonNetwork.Shared.Models; using DysonNetwork.Shared.Proto; using DysonNetwork.Shared.Registry; using DysonNetwork.Zone.Publication; +using Microsoft.AspNetCore.Mvc; // Add this using statement using Microsoft.AspNetCore.Mvc.RazorPages; using PostType = DysonNetwork.Shared.Models.PostType; @@ -14,6 +15,8 @@ public class PostsModel( MarkdownConverter markdownConverter ) : PageModel { + [FromQuery] public bool ShowAll { get; set; } = false; + public SnPublicationSite? Site { get; set; } public SnPublisher? Publisher { get; set; } public List Posts { get; set; } = []; @@ -39,6 +42,8 @@ public class PostsModel( PublisherId = Site!.PublisherId.ToString() }; + if (!ShowAll) request.Types_.Add(DysonNetwork.Shared.Proto.PostType.Article); + var response = await postClient.ListPostsAsync(request); if (response?.Posts != null)