Skip to content

Commit

Permalink
♻️ 인증제 폼을 찾을 수 없는 경우, 빈 배열을 반환
Browse files Browse the repository at this point in the history
  • Loading branch information
enbraining committed Sep 24, 2024
1 parent b602a6b commit a4e0980
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import team.msg.sms.domain.authentication.service.*
import team.msg.sms.domain.file.dto.res.FileResponseData
import team.msg.sms.domain.file.service.FileService
import java.util.*
import kotlin.math.max

@UseCase
class QueryAuthenticationFormUseCase(
Expand All @@ -25,7 +24,15 @@ class QueryAuthenticationFormUseCase(
) {
@Transactional(readOnly = true)
fun execute(): QueryAuthenticationFormResponseData {
val authenticationFormId = authenticationFormService.getActiveAuthenticationFormId()
val authenticationFormId = runCatching {
authenticationFormService.getActiveAuthenticationFormId()
}.getOrNull()

authenticationFormId ?: return QueryAuthenticationFormResponseData(
files = emptyList(),
content = emptyList()
)

val files = fetchFiles(authenticationFormId)
val groups = fetchAuthenticationGroups(authenticationFormId)
val authenticationSections = fetchAuthenticationSections(groups)
Expand Down

0 comments on commit a4e0980

Please sign in to comment.