del front and add auth
This commit is contained in:
@@ -58,8 +58,8 @@ public class MessageService {
|
||||
: m.getSender().getId();
|
||||
|
||||
String email = isMeSender
|
||||
? m.getReceiver().getEmail()
|
||||
: m.getSender().getEmail();
|
||||
? m.getReceiver().getLogin()
|
||||
: m.getSender().getLogin();
|
||||
|
||||
int unread = messageRepository.countUnread(userId, otherUserId);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class UserService {
|
||||
|
||||
public User getCurrentUser() {
|
||||
|
||||
return repository.findByEmail("moscow_city231@rambler.ru")
|
||||
return repository.findByLogin("moscow_city231@rambler.ru")
|
||||
.orElseThrow(() -> new ApiException(
|
||||
ErrorCode.NOT_FOUND,
|
||||
"User not found",
|
||||
|
||||
Reference in New Issue
Block a user