Endpoints to see groups
This commit is contained in:
@@ -8,7 +8,9 @@ public class GetGroupByIdSpec : SingleResultSpecification<Group>
|
||||
public GetGroupByIdSpec(int groupId)
|
||||
{
|
||||
Query
|
||||
.Include(x => x.UserGroups)
|
||||
.Include(x => x.UserGroups!)
|
||||
.ThenInclude(x => x.User)
|
||||
.Include(x => x.Messages)
|
||||
.Where(x => x.Id == groupId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using Ardalis.Specification;
|
||||
using BeReadyBackend.Models;
|
||||
|
||||
namespace BeReadyBackend.Specifications.Groups;
|
||||
|
||||
public class GetGroupsByUserIdSpec : Specification<UserGroup>
|
||||
{
|
||||
public GetGroupsByUserIdSpec(int userId)
|
||||
{
|
||||
Query
|
||||
.Include(x => x.Group)
|
||||
.Where(x => x.UserId == userId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user