Skip to content

Commit

Permalink
[refactor] : 유저가 생성한 이벤트 삭제 시 쿼리 DSL을 사용한다
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbang105 committed Oct 14, 2024
1 parent bcb7ab3 commit 8c18a84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/side/onetime/repository/EventRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import org.springframework.data.jpa.repository.JpaRepository;
import side.onetime.domain.Event;
import side.onetime.repository.custom.EventRepositoryCustom;

import java.util.Optional;
import java.util.UUID;

public interface EventRepository extends JpaRepository<Event,Long> {
public interface EventRepository extends JpaRepository<Event,Long>, EventRepositoryCustom {
Optional<Event> findByEventId(UUID eventId);
boolean existsByEventId(UUID eventId);
}
2 changes: 1 addition & 1 deletion src/main/java/side/onetime/service/EventService.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,6 @@ public void removeUserCreatedEvent(String authorizationHeader, String eventId) {
throw new EventParticipationException(EventParticipationErrorResult._IS_NOT_USERS_CREATED_EVENT_PARTICIPATION);
}

eventRepository.delete(event);
eventRepository.deleteUserEvent(event);
}
}

0 comments on commit 8c18a84

Please sign in to comment.