Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add request and test. Add gateway #5

Merged
merged 6 commits into from
Aug 18, 2024

Conversation

Nikolaev-Java
Copy link
Owner

No description provided.

itemRequest = itemRequestRepository.findById(itemDto.getRequestId())
.orElseThrow(() -> new NotFoundException("Request with id - " + itemDto.getRequestId() + " not found"));
}
Item item = itemRepository.save(itemMapper.fromDto(itemDto, user, itemRequest));
return itemMapper.toDto(item);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

над методами сервиса необходимо расставить @transactional (только над теми, которые этого требуют, т.е. изменяют состояние бд)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в методе checkIfExistsUser нет необходимости - у репозитория есть метод exist

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

спасибо, я внутри этого метода заменил метод получения юзера на проверку. Мне просто надо исключение выбрасывать что юзера нет.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

если я добавлю @transactional в сервисе Usera над методами создания и изменения у меня не получается отловить ошибку, чтобы вывести информацию что email такой уже есть.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это не должно быть связано с этой аннотацией

@Nikolaev-Java Nikolaev-Java merged commit 0841616 into main Aug 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants