diff --git a/BeReadyBackend/DTO/Users/GetUserDetailsDto.cs b/BeReadyBackend/DTO/Users/GetUserDetailsDto.cs index 43f749b..2f795c3 100644 --- a/BeReadyBackend/DTO/Users/GetUserDetailsDto.cs +++ b/BeReadyBackend/DTO/Users/GetUserDetailsDto.cs @@ -7,7 +7,7 @@ public class GetUserDetailsDto public string? Name { get; set; } public string? Username { get; set; } public string? Email { get; set; } - public int? DesignationId { get; set; } + public string? DesignationName { get; set; } public DateTime CreationDate { get; set; } public GetUserStatsDto? GetUserStatsDto { get; set; } } \ No newline at end of file diff --git a/BeReadyBackend/MappingProfiles/EntityToDtoMappings.cs b/BeReadyBackend/MappingProfiles/EntityToDtoMappings.cs index 1303c89..8796070 100644 --- a/BeReadyBackend/MappingProfiles/EntityToDtoMappings.cs +++ b/BeReadyBackend/MappingProfiles/EntityToDtoMappings.cs @@ -26,6 +26,7 @@ public class EntityToDtoMappings : Profile .ForMember(dest => dest.DesignationName, opt => opt.MapFrom(src => src.Designation!.Label)); CreateMap() + .ForMember(dest => dest.DesignationName, opt => opt.MapFrom(src => src.Designation!.Label)) .ForMember(dest => dest.GetUserStatsDto, opt => opt.MapFrom(src => src)); CreateMap(); diff --git a/BeReadyBackend/Validators/Users/GetUserDetailsDtoValidator.cs b/BeReadyBackend/Validators/Users/GetUserDetailsDtoValidator.cs index b956657..d4e92ab 100644 --- a/BeReadyBackend/Validators/Users/GetUserDetailsDtoValidator.cs +++ b/BeReadyBackend/Validators/Users/GetUserDetailsDtoValidator.cs @@ -44,9 +44,9 @@ public class GetUserDetailsDtoValidator : Validator .NotEmpty() .WithMessage("CreationDate is required"); - When(x => x.DesignationId is not null, () => + When(x => x.DesignationName is not null, () => { - RuleFor(x => x.DesignationId) + RuleFor(x => x.DesignationName) .NotEmpty() .WithMessage("DesignationId is required"); });