Skip to content

Commit

Permalink
EPMRPP-95844 fix find by id
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx committed Jan 3, 2025
1 parent d3856df commit 52b4cd5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.epam.reportportal.api.model.Invitation;
import com.epam.reportportal.api.model.InvitationRequest;
import com.epam.reportportal.api.model.InvitationRequestOrganizationsInner;
import com.epam.reportportal.rules.exception.ErrorType;
import com.epam.reportportal.rules.exception.ReportPortalException;
import com.epam.ta.reportportal.commons.ReportPortalUser;
import com.epam.ta.reportportal.core.integration.GetIntegrationHandler;
Expand Down Expand Up @@ -148,7 +149,9 @@ public Invitation createUserInvitation(InvitationRequest request, ReportPortalUs

@Override
public Invitation getInvitation(String invitationId, String baseUrl) {
var bid = userCreationBidRepository.getById(invitationId);
var bid = userCreationBidRepository.findById(invitationId)
.orElseThrow(() -> new ReportPortalException(ErrorType.NOT_FOUND, "User invitation id"));

var invitation = InvitationConverter.TO_INVITATION.apply(bid);
invitation.setLink(getEmailLink(baseUrl, bid.getUuid()));
return invitation;
Expand Down

0 comments on commit 52b4cd5

Please sign in to comment.