refactor code of challenges and proofs in profil vue

This commit is contained in:
2026-05-14 11:38:41 +01:00
parent 01b7675703
commit f86fd80efc
3 changed files with 12 additions and 20 deletions
@@ -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);
}