mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
hot fix for friends controller
This commit is contained in:
@@ -22,6 +22,10 @@ public class UsersRepository : IUsersRepository
|
||||
{
|
||||
return await _context.Users
|
||||
.AsNoTracking()
|
||||
.Include(u => u.Invite)
|
||||
.Include(u => u.ReceivedFriendRequests)
|
||||
.Include(u => u.SentFriendRequests)
|
||||
.AsSplitQuery()
|
||||
.ToListOrThrowIfEmpty(new NotFoundException("Users in Database not exists"));
|
||||
}
|
||||
|
||||
@@ -48,6 +52,10 @@ public class UsersRepository : IUsersRepository
|
||||
return await _context.Users
|
||||
.AsNoTracking()
|
||||
.Where(x => ids.Contains(x.Id))
|
||||
.Include(u => u.Invite)
|
||||
.Include(u => u.ReceivedFriendRequests)
|
||||
.Include(u => u.SentFriendRequests)
|
||||
.AsSplitQuery()
|
||||
.ToListOrThrowIfEmpty(new NotFoundByKeyException<IEnumerable<Guid>>(ids,"Users with given ids not found"));
|
||||
}
|
||||
|
||||
@@ -70,6 +78,9 @@ public class UsersRepository : IUsersRepository
|
||||
{
|
||||
return await _context.Users
|
||||
.AsNoTracking()
|
||||
.Include(u => u.Invite)
|
||||
.Include(u => u.ReceivedFriendRequests)
|
||||
.Include(u => u.SentFriendRequests)
|
||||
.AsSplitQuery()
|
||||
.Where(u => u.Id != currentUserId &&
|
||||
u.Username.ToLower().Contains(query.ToLower()) &&
|
||||
@@ -211,5 +222,4 @@ public class UsersRepository : IUsersRepository
|
||||
{
|
||||
return _context.Users.AnyAsync(u => u.Username == username);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user