make content repo creating content more readable

This commit is contained in:
InsanusMokrassar 2020-12-01 13:18:39 +06:00
parent ed46c888e3
commit 703f3c057c
2 changed files with 8 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -61,10 +61,13 @@ class BusinessWriteContentRepo(
return values.mapNotNull { content -> return values.mapNotNull { content ->
if (content is OtherContentLinkContent) { if (content is OtherContentLinkContent) {
adapters.forEach { adapters.forEach {
return@mapNotNull RegisteredContent( val existsContent = it.getContent(content.otherId)
content.otherId, if (existsContent != null) {
it.getContent(content.otherId) ?: return@forEach return@mapNotNull RegisteredContent(
) content.otherId,
existsContent
)
}
} }
} }
val contentId = generateContentId() val contentId = generateContentId()