From 9be3101b5567831b11bb50a54c4f5c4bceeccef1 Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Wed, 4 Jun 2025 20:42:33 -0500 Subject: [PATCH] Added reading list owner to the API for Mio's Mihon work. --- API/DTOs/ReadingLists/ReadingListDto.cs | 5 +++++ API/Helpers/AutoMapperProfiles.cs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/API/DTOs/ReadingLists/ReadingListDto.cs b/API/DTOs/ReadingLists/ReadingListDto.cs index cbc16275d..47a526411 100644 --- a/API/DTOs/ReadingLists/ReadingListDto.cs +++ b/API/DTOs/ReadingLists/ReadingListDto.cs @@ -49,6 +49,11 @@ public sealed record ReadingListDto : IHasCoverImage /// public required AgeRating AgeRating { get; set; } = AgeRating.Unknown; + /// + /// Username of the User that owns (in the case of a promoted list) + /// + public string OwnerUserName { get; set; } + public void ResetColorScape() { PrimaryColor = string.Empty; diff --git a/API/Helpers/AutoMapperProfiles.cs b/API/Helpers/AutoMapperProfiles.cs index 75183fdcd..3f58f7070 100644 --- a/API/Helpers/AutoMapperProfiles.cs +++ b/API/Helpers/AutoMapperProfiles.cs @@ -287,7 +287,8 @@ public class AutoMapperProfiles : Profile CreateMap(); CreateMap() - .ForMember(dest => dest.ItemCount, opt => opt.MapFrom(src => src.Items.Count)); + .ForMember(dest => dest.ItemCount, opt => opt.MapFrom(src => src.Items.Count)) + .ForMember(dest => dest.OwnerUserName, opt => opt.MapFrom(src => src.AppUser.UserName)); CreateMap(); CreateMap(); CreateMap();