Created endpoints to see all challenges and proofs of the user in her personnal page
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user