mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Improve friends search and error handling in API
Refactored FriendsController to provide more precise error responses and input validation. Enhanced FriendsService to handle new exception types and improved user search logic. Added tests for user search, updated repository to throw on empty search results, and implemented User equality override. Cleaned up Program.cs controller JSON options.
This commit is contained in:
@@ -84,7 +84,7 @@ public class UsersRepository : IUsersRepository
|
||||
(f.RequesterId == u.Id && f.AddresseeId == currentUserId)))
|
||||
.Take(20)
|
||||
.OrderBy(u => u.Username)
|
||||
.ToListAsync();
|
||||
.ToListOrThrowIfEmpty(new NotFoundByKeyException<(string, Guid)>((query, currentUserId), $"Users with given query for user {currentUserId} not found"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user