-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix: post 조회 예외처리 추가
- Loading branch information
Showing
2 changed files
with
12 additions
and
5 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
src/main/java/land/leets/Carrot/domain/post/repository/PostImageRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package land.leets.Carrot.domain.post.repository; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import land.leets.Carrot.domain.post.entity.PostImage; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface PostImageRepository extends JpaRepository<PostImage, Long> { | ||
@Query("SELECT p FROM PostImage p WHERE p.postSnapshot.id = :postsnapshotId") | ||
List<PostImage> findByPostSnapshotId(@Param("postsnapshotId") Long postsnapshotId); | ||
Optional<List<PostImage>> findByPostSnapshotId(@Param("postsnapshotId") Long postsnapshotId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters