mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(dir): ✨ include primaryViewUrl in /lists endpoint
This commit is contained in:
parent
fc177fde3e
commit
2510a7e426
2 changed files with 7 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FilterLists.Directory.Api.Contracts.Models
|
||||
{
|
||||
|
|
@ -11,6 +12,7 @@ public class ListVm
|
|||
public IEnumerable<int>? SyntaxIds { get; init; }
|
||||
public IEnumerable<string>? Iso6391s { get; init; }
|
||||
public IEnumerable<int>? TagIds { get; init; }
|
||||
public Uri? PrimaryViewUrl { get; init; }
|
||||
public IEnumerable<int>? MaintainerIds { get; init; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,10 @@ public ListVmProfile()
|
|||
.ForMember(fl => fl.TagIds,
|
||||
o => o.MapFrom(fl =>
|
||||
fl.FilterListTags.Select(flt => flt.TagId).OrderBy(tid => tid).AsEnumerable()))
|
||||
.ForMember(fl => fl.PrimaryViewUrl,
|
||||
o => o.MapFrom(fl =>
|
||||
fl.ViewUrls.OrderBy(u => u.SegmentNumber).ThenBy(u => u.Primariness).Select(u => u.Url)
|
||||
.FirstOrDefault()))
|
||||
.ForMember(fl => fl.MaintainerIds,
|
||||
o => o.MapFrom(fl =>
|
||||
fl.FilterListMaintainers.Select(flm => flm.MaintainerId).OrderBy(mid => mid)
|
||||
|
|
|
|||
Loading…
Reference in a new issue