fix(content): 삭제 콘텐츠의 상단 고정을 비활성화한다
This commit is contained in:
@@ -207,8 +207,14 @@ class AudioContentService(
|
||||
val audioContent = repository.findByIdAndCreatorId(audioContentId, member.id!!)
|
||||
?: throw SodaException(messageKey = "content.error.invalid_content_retry")
|
||||
|
||||
val pinContent = pinContentRepository.findByContentIdAndMemberId(
|
||||
contentId = audioContentId,
|
||||
memberId = member.id!!
|
||||
)
|
||||
|
||||
audioContent.isActive = false
|
||||
audioContent.releaseDate = null
|
||||
pinContent?.isActive = false
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
||||
@@ -15,6 +15,7 @@ interface PinContentQueryRepository {
|
||||
class PinContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : PinContentQueryRepository {
|
||||
override fun getPinContentList(memberId: Long, active: Boolean?): List<PinContent> {
|
||||
var where = pinContent.member.id.eq(memberId)
|
||||
.and(pinContent.content.isActive.eq(true))
|
||||
|
||||
if (active != null) {
|
||||
where = where.and(pinContent.isActive.eq(active))
|
||||
@@ -30,6 +31,7 @@ class PinContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) :
|
||||
override fun findByContentIdAndMemberId(contentId: Long, memberId: Long, active: Boolean?): PinContent? {
|
||||
var where = pinContent.content.id.eq(contentId)
|
||||
.and(pinContent.member.id.eq(memberId))
|
||||
.and(pinContent.content.isActive.eq(true))
|
||||
|
||||
if (active != null) {
|
||||
where = where
|
||||
|
||||
Reference in New Issue
Block a user