Skip to content

Commit

Permalink
refactor(PostCrudService): 포토카드 저장안됨 이슈 수정 (@Trancational 삭제)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiminseon committed Dec 6, 2023
1 parent 414de38 commit 5e4dbd8
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
import java.io.IOException;

@Service
@Transactional
@RequiredArgsConstructor
@Slf4j
public class PostCrudService {

private final PostCrudRepository postCrudRepository;
private final FileUploadService fileUploadService;
@Transactional

public PostEntity savePost(PostBackDto postDto, MultipartFile image, Long id) throws IOException {
if(!image.isEmpty()) {
String storedFileName = fileUploadService.upload(image);
Expand All @@ -31,7 +30,7 @@ public PostEntity savePost(PostBackDto postDto, MultipartFile image, Long id) th
}


@Transactional

public boolean deletePost(Long postId) {
PostEntity postEntity = postCrudRepository.findByPostId(postId);

Expand All @@ -49,7 +48,7 @@ public boolean deletePost(Long postId) {
}


@Transactional

public PostEntity modifyPost(Long postId, PostBackDto postDto, MultipartFile image, Long id) throws IOException {
PostEntity postEntity = postCrudRepository.findByPostId(postId);

Expand Down

0 comments on commit 5e4dbd8

Please sign in to comment.