Skip to content

Commit

Permalink
uf
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamv108 committed Jan 11, 2024
1 parent c67f824 commit 9fbdd9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/code/shubham/core/iam/services/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
import code.shubham.core.iammodels.GetOrCreateUser;
import code.shubham.core.iammodels.GetUserResponse;
import code.shubham.core.iammodels.UserDTO;
import jakarta.transaction.Transactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Transactional
@Service
public class UserService implements IUserService {

Expand Down Expand Up @@ -40,8 +41,7 @@ public GetUserResponse getOrCreate(final GetOrCreateUser.Request request) {
.build();
}

@Transactional(rollbackOn = { RuntimeException.class })
private User create(final User user) {
public User create(final User user) {
final User persisted = this.repository.save(user);
this.userRoleService.setRoleToUser("USER", user.getId());
return persisted;
Expand Down

0 comments on commit 9fbdd9e

Please sign in to comment.