Skip to content

Commit

Permalink
refactor :: null 허용
Browse files Browse the repository at this point in the history
  • Loading branch information
4mjeo committed Feb 27, 2024
1 parent dd2524e commit d6cc265
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ class ProjectServiceImpl (

val logoUrl = logo.let { fileService.upload(it, req.projectNameEn).url } ?: ""
val projectImageUrls = projectImage?.let {
fileService.uploads(it, req.projectNameEn).files.map { fileResponse -> fileResponse.url }
} ?: emptyList()
if (it.isNotEmpty()) {
fileService.uploads(it, req.projectNameEn).files.map { fileResponse -> fileResponse.url }
}else {
null
}
}

val project = Project(
null,
Expand Down Expand Up @@ -79,8 +83,12 @@ class ProjectServiceImpl (
val logoUrl = fileService.upload(logo, project.projectNameEn).url

val projectImageUrl = projectImage?.let {
fileService.uploads(it, project.projectNameEn).files.map {fileUrlResponse -> fileUrlResponse.url }
} ?: project.projectImage
if (it.isNotEmpty()) {
fileService.uploads(it, project.projectNameEn).files.map {fileUrlResponse -> fileUrlResponse.url }
} else {
project.projectImage
}
}

return projectRepository.save(Project(
projectId,
Expand Down

0 comments on commit d6cc265

Please sign in to comment.