make content repo creating content more readable
This commit is contained in:
parent
ed46c888e3
commit
703f3c057c
File diff suppressed because one or more lines are too long
@ -61,12 +61,15 @@ class BusinessWriteContentRepo(
|
|||||||
return values.mapNotNull { content ->
|
return values.mapNotNull { content ->
|
||||||
if (content is OtherContentLinkContent) {
|
if (content is OtherContentLinkContent) {
|
||||||
adapters.forEach {
|
adapters.forEach {
|
||||||
|
val existsContent = it.getContent(content.otherId)
|
||||||
|
if (existsContent != null) {
|
||||||
return@mapNotNull RegisteredContent(
|
return@mapNotNull RegisteredContent(
|
||||||
content.otherId,
|
content.otherId,
|
||||||
it.getContent(content.otherId) ?: return@forEach
|
existsContent
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
val contentId = generateContentId()
|
val contentId = generateContentId()
|
||||||
val adapter = adapters.firstOrNull { it.storeContent(contentId, content) } ?: return@mapNotNull null
|
val adapter = adapters.firstOrNull { it.storeContent(contentId, content) } ?: return@mapNotNull null
|
||||||
if (!helperRepo.saveType(contentId, adapter.type)) {
|
if (!helperRepo.saveType(contentId, adapter.type)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user