Skip to content

Commit

Permalink
Making migrateUser function transactional
Browse files Browse the repository at this point in the history
  • Loading branch information
DomWestAnd committed Aug 4, 2023
1 parent be74513 commit aeb4fe2
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import gov.cabinetoffice.gap.adminbackend.repositories.GrantApplicantRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;

Expand All @@ -15,6 +16,7 @@ public class UserService {

private final GrantApplicantRepository grantApplicantRepository;

@Transactional
public void migrateUser(final String oneLoginSub, final UUID colaSub) {
gapUserRepository.findByUserSub(colaSub.toString()).ifPresent(gapUser -> {
gapUser.setUserSub(oneLoginSub);
Expand Down

0 comments on commit aeb4fe2

Please sign in to comment.