Endpoints to see groups

This commit is contained in:
2026-02-22 16:02:34 +01:00
parent f75eecc712
commit c67cdf8dd8
9 changed files with 112 additions and 2 deletions
@@ -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);
}
}