Cleaned code
This commit is contained in:
@@ -28,7 +28,8 @@ public class GetAllPostsEndpoint(PostsRepository postsRepository, UserService us
|
|||||||
Likes = x.Likes,
|
Likes = x.Likes,
|
||||||
Proof = x.User?.UserRandomChallenges?
|
Proof = x.User?.UserRandomChallenges?
|
||||||
.SingleOrDefault(u =>
|
.SingleOrDefault(u =>
|
||||||
u.RandomChallenge?.GeneratedAt is not null && DateOnly.FromDateTime(u.RandomChallenge.GeneratedAt.Value) == DateOnly.FromDateTime(x.CreationDate))
|
u.RandomChallenge?.GeneratedAt is not null
|
||||||
|
&& DateOnly.FromDateTime(u.RandomChallenge.GeneratedAt.Value) == DateOnly.FromDateTime(x.CreationDate))
|
||||||
?.Proof,
|
?.Proof,
|
||||||
UserId = x.UserId,
|
UserId = x.UserId,
|
||||||
Username = x.User?.Username,
|
Username = x.User?.Username,
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class PatchProofEndpoint(
|
|||||||
Libelle = "test pour le moment",
|
Libelle = "test pour le moment",
|
||||||
UserId = userId
|
UserId = userId
|
||||||
};
|
};
|
||||||
|
|
||||||
await postsRepository.AddAsync(post, ct);
|
await postsRepository.AddAsync(post, ct);
|
||||||
await Send.NoContentAsync(ct);
|
await Send.NoContentAsync(ct);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class GetAllUserProofsEndpoint(UsersRepository usersRepository, UserServi
|
|||||||
await Send.NotFoundAsync(ct);
|
await Send.NotFoundAsync(ct);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<GetUserProofDto> proofs = user.UserRandomChallenges?
|
List<GetUserProofDto> proofs = user.UserRandomChallenges?
|
||||||
.Where(x => x.Proof is not null)
|
.Where(x => x.Proof is not null)
|
||||||
.Select(x => new GetUserProofDto
|
.Select(x => new GetUserProofDto
|
||||||
|
|||||||
Reference in New Issue
Block a user