Skip to content

Commit

Permalink
prevent wikipage duplication on sitemap by avoiding adding items to t…
Browse files Browse the repository at this point in the history
…he static list (#2014)
  • Loading branch information
Masterjun3 authored Oct 20, 2024
1 parent 8f9e918 commit 55f7277
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions TASVideos/Pages/Wiki/SiteMap.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class SiteMapModel(ApplicationDbContext db) : BasePageModel
AccessRestriction(t)))
.ToList();

public List<SiteMapEntry> Map => CorePages;
public List<SiteMapEntry> Map { get; set; } = [];

public void OnGet()
{
Expand All @@ -29,9 +29,10 @@ public void OnGet()
.Select(w => w.PageName)
.ToList();

Map.AddRange(wikiPages
Map = CorePages.Concat(wikiPages
.Distinct()
.Select(p => new SiteMapEntry(p, true, "Anonymous")));
.Select(p => new SiteMapEntry(p, true, "Anonymous")))
.ToList();
}

private static string AccessRestriction(MemberInfo type)
Expand Down

0 comments on commit 55f7277

Please sign in to comment.