diff --git a/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/api/business/content_adapters/binary/BinaryBusinessContentRepoContentAdapter.kt b/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/api/business/content_adapters/binary/BinaryBusinessContentRepoContentAdapter.kt index d892836c..b7aab38b 100644 --- a/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/api/business/content_adapters/binary/BinaryBusinessContentRepoContentAdapter.kt +++ b/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/api/business/content_adapters/binary/BinaryBusinessContentRepoContentAdapter.kt @@ -11,8 +11,8 @@ import kotlinx.serialization.json.Json private val format = Json { ignoreUnknownKeys = true } class BinaryBusinessContentRepoContentAdapter( - private val dataStore: KeyValueRepo, - private val filesStore: KeyValueRepo, + private val dataStore: KeyValueRepo, + private val filesStore: KeyValueRepo, private val removeOnAbsentInOneOfStores: Boolean = false ) : BusinessContentRepoContentAdapter { override val type: AdapterType @@ -20,7 +20,7 @@ class BinaryBusinessContentRepoContentAdapter( override suspend fun storeContent(contentId: ContentId, content: Content): Boolean { (content as? BinaryContent) ?.also { - filesStore.set(it.originalFileName, it.dataAllocator()) + filesStore.set(contentId, it.dataAllocator()) dataStore.set( contentId, format.encodeToString(BinaryContent.serializer(), it.copy { ByteArray(0) })