Created endpoints to see all challenges and proofs of the user in her personnal page

This commit is contained in:
2026-02-21 21:58:43 +01:00
parent 115f4de993
commit a701909d9d
8 changed files with 170 additions and 4 deletions
@@ -0,0 +1,17 @@
using Ardalis.Specification;
using BeReadyBackend.Models;
namespace BeReadyBackend.Specifications.Users;
public class GetProofOrChallengeByUserIdSpec : SingleResultSpecification<User>
{
public GetProofOrChallengeByUserIdSpec(int userId)
{
Query
.Include(x => x.UserRandomChallenges!)
.ThenInclude(x => x.RandomChallenge)
.Include(x => x.UserGroups!)
.ThenInclude(x => x.Group)
.Where(x => x.Id == userId);
}
}
@@ -3,7 +3,7 @@ using BeReadyBackend.Models;
namespace BeReadyBackend.Specifications.Users;
public class GetUserByIdSpec : SingleResultSpecification<User>
public class GetUserByIdSpec : SingleResultSpecification<User>
{
public GetUserByIdSpec(int userId)
{