refactor code of challenges and proofs in profil vue
This commit is contained in:
@@ -25,17 +25,14 @@ public class GetAllUserProofsEndpoint(UsersRepository usersRepository, UserServi
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
List<GetUserProofDto> proofs = [];
|
||||
if (user.UserRandomChallenges is not null)
|
||||
proofs.AddRange(
|
||||
user.UserRandomChallenges
|
||||
.Where(x => x.Proof is not null)
|
||||
.Select(x => new GetUserProofDto
|
||||
{
|
||||
Proof = x.Proof
|
||||
})
|
||||
);
|
||||
|
||||
List<GetUserProofDto> proofs = user.UserRandomChallenges?
|
||||
.Where(x => x.Proof is not null)
|
||||
.Select(x => new GetUserProofDto
|
||||
{
|
||||
Proof = x.Proof
|
||||
})
|
||||
.ToList() ?? [];
|
||||
|
||||
await Send.OkAsync(proofs, ct);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user