Added and mapped date into dto for all challenges past of user
This commit is contained in:
@@ -5,4 +5,5 @@ public class GetUserChallengeDto
|
||||
public string? ChallengeTitle { get; set; }
|
||||
public string? ChallengeDescription { get; set; }
|
||||
public int ChallengeDuration { get; set; }
|
||||
public DateOnly ChallengeStartDate { get; set; }
|
||||
}
|
||||
@@ -36,12 +36,14 @@ public class EntityToDtoMappings : Profile
|
||||
|
||||
CreateMap<RandomChallenge, GetUserChallengeDto>()
|
||||
.ForMember(dest => dest.ChallengeTitle, opt => opt.MapFrom(src => src.Libelle))
|
||||
.ForMember(dest => dest.ChallengeDuration, opt => opt.MapFrom(src => src.Duration));
|
||||
.ForMember(dest => dest.ChallengeDuration, opt => opt.MapFrom(src => src.Duration))
|
||||
.ForMember(dest => dest.ChallengeStartDate, opt => opt.MapFrom(src => DateOnly.FromDateTime(src.GeneratedAt!.Value)));
|
||||
|
||||
CreateMap<Group, GetUserChallengeDto>()
|
||||
.ForMember(dest => dest.ChallengeTitle, opt => opt.MapFrom(src => src.Title))
|
||||
.ForMember(dest => dest.ChallengeDescription, opt => opt.MapFrom(src => src.Description))
|
||||
.ForMember(dest => dest.ChallengeDuration, opt => opt.MapFrom(src => src.Duration));
|
||||
.ForMember(dest => dest.ChallengeDuration, opt => opt.MapFrom(src => src.Duration))
|
||||
.ForMember(dest => dest.ChallengeStartDate, opt => opt.MapFrom(src => DateOnly.FromDateTime(src.CreationDate)));
|
||||
|
||||
CreateMap<UserFriend, GetFriendDto>()
|
||||
.ForMember(dest => dest.Username, opt => opt.MapFrom(src => src.Friend!.Username))
|
||||
|
||||
Reference in New Issue
Block a user