Cleaned code
This commit is contained in:
@@ -7,7 +7,8 @@ using FastEndpoints;
|
||||
|
||||
namespace BeReadyBackend.Endpoints.Users;
|
||||
|
||||
public class GetAllUserChallengesEndpoint(UserRandomChallengesRepository userRandomChallengesRepository, UserService userService, AutoMapper.IMapper mapper) : EndpointWithoutRequest<List<GetUserChallengeDto>>
|
||||
public class GetAllUserChallengesEndpoint(UserRandomChallengesRepository userRandomChallengesRepository, UserService userService, AutoMapper.IMapper mapper)
|
||||
: EndpointWithoutRequest<List<GetUserChallengeDto>>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
@@ -22,7 +23,7 @@ public class GetAllUserChallengesEndpoint(UserRandomChallengesRepository userRan
|
||||
|
||||
List<GetUserChallengeDto> challenges = userRandomChallenge
|
||||
.Select(x => mapper.Map<GetUserChallengeDto>(x.RandomChallenge))
|
||||
.ToList() ;
|
||||
.ToList();
|
||||
|
||||
await Send.OkAsync(challenges.OrderByDescending(x => x.ChallengeStartDate).ToList(), ct);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ using FastEndpoints;
|
||||
|
||||
namespace BeReadyBackend.Endpoints.Users;
|
||||
|
||||
public class GetAllUserProofsEndpoint(UserRandomChallengesRepository userRandomChallengesRepository, UserService userService, AutoMapper.IMapper mapper) : EndpointWithoutRequest<List<GetUserProofDto>>
|
||||
public class GetAllUserProofsEndpoint(UserRandomChallengesRepository userRandomChallengesRepository, UserService userService, AutoMapper.IMapper mapper)
|
||||
: EndpointWithoutRequest<List<GetUserProofDto>>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
@@ -21,9 +22,9 @@ public class GetAllUserProofsEndpoint(UserRandomChallengesRepository userRandomC
|
||||
List<UserRandomChallenge> userProofs = await userRandomChallengesRepository.ListAsync(new GetUserProofByUserIdSpec(userId), ct);
|
||||
|
||||
List<GetUserProofDto> proofs = userProofs
|
||||
.Select( mapper.Map<GetUserProofDto>)
|
||||
.Select(mapper.Map<GetUserProofDto>)
|
||||
.ToList();
|
||||
|
||||
|
||||
await Send.OkAsync(proofs, ct);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user