Skip to content

Commit

Permalink
refactor: 구독 취소시 구독 상태 체크 로직 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
hun-ca committed Jun 23, 2024
1 parent 37fa8a6 commit ce06d8c
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.few.api.domain.subscription

import com.few.api.repo.dao.subscription.SubscriptionDao
import com.few.api.repo.dao.subscription.command.UpdateDeletedAtInWorkbookSubscriptionCommand
import com.few.api.repo.dao.subscription.query.CountWorkbookSubscriptionQuery
import com.few.api.domain.subscription.`in`.UnsubscribeWorkbookUseCaseIn
import org.springframework.stereotype.Component
import org.springframework.transaction.annotation.Transactional
Expand All @@ -16,15 +15,6 @@ class UnsubscribeWorkbookUseCase(
fun execute(useCaseIn: UnsubscribeWorkbookUseCaseIn) {
// TODO: request sending email

// 구독중이 아닌지 확인
CountWorkbookSubscriptionQuery(memberId = useCaseIn.memberId, workbookId = useCaseIn.workbookId).let { query ->
subscriptionDao.selectCountWorkbookSubscription(query).let { cnt ->
if (cnt == 0) {
throw RuntimeException("Already subscribed")
}
}
}

subscriptionDao.updateDeletedAtInWorkbookSubscription(
UpdateDeletedAtInWorkbookSubscriptionCommand(
memberId = useCaseIn.memberId,
Expand Down

0 comments on commit ce06d8c

Please sign in to comment.