Skip to content

Commit

Permalink
Merge pull request #413 from GSM-MSG/hotfix/412-empty-authentication-…
Browse files Browse the repository at this point in the history
…form-500

🔁 인증제 폼을 찾을 수 없는 경우, 빈 배열을 반환
  • Loading branch information
enbraining authored Sep 26, 2024
2 parents b602a6b + a4e0980 commit 871482b
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 871482b

Please sign in to comment.