add "me" endpoint

This commit is contained in:
Вячеслав 2025-05-13 18:09:06 +05:00
parent 98b38f645f
commit ae1a8d2b97
7 changed files with 49 additions and 10 deletions

View file

@ -19,6 +19,11 @@ public class UserService : IUserService
return await _userRepository.GetUserByEmail(email) ?? throw new NotFoundException("Email not found");
}
public async Task<User> GetUserById(int id)
{
return await _userRepository.GetByIdAsync(id) ?? throw new NotFoundException("User not found");
}
public async Task<bool> IsEmailTaken(string email)
{
return await _userRepository.GetUserByEmail(email) != null;