Skip to content

Commit

Permalink
feat: spot 생성시 spot생성 결과 반환 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
wonjun0120 committed Jul 4, 2024
1 parent 81a0c9a commit dd2e131
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public class SpotController {
@PostMapping
public ResponseEntity<?> upload(@RequestBody SpotRequestDto dto) {
try {
spotService.upload(dto);
return ResponseEntity.ok().body("스팟 업로드 성공.");
Spot spot = spotService.upload(dto);
return ResponseEntity.ok().body(spot);
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("스팟 업로드에 실패하였습니다.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class SpotService {
private final CategorySpotRepository categorySpotRepository;

@Transactional
public void upload(SpotRequestDto dto) {
public Spot upload(SpotRequestDto dto) {

User user = userRepository.findUserById(dto.getUserId());

Expand Down Expand Up @@ -55,7 +55,7 @@ public void upload(SpotRequestDto dto) {

// CategorySpot 저장
categorySpotRepository.saveAll(categorySpots);

return savedSpot;
}

@Transactional
Expand Down

0 comments on commit dd2e131

Please sign in to comment.