mirror of
https://github.com/bitwarden/android.git
synced 2025-02-16 20:09:59 +03:00
BIT-1912: Store collection ids after creation or share. (#1033)
This commit is contained in:
parent
c33fc8cf97
commit
c262dc03c1
2 changed files with 25 additions and 4 deletions
|
@ -633,7 +633,12 @@ class VaultRepositoryImpl(
|
|||
),
|
||||
)
|
||||
}
|
||||
.onSuccess { vaultDiskSource.saveCipher(userId = userId, cipher = it) }
|
||||
.onSuccess {
|
||||
vaultDiskSource.saveCipher(
|
||||
userId = userId,
|
||||
cipher = it.copy(collectionIds = collectionIds),
|
||||
)
|
||||
}
|
||||
.fold(
|
||||
onFailure = { CreateCipherResult.Error },
|
||||
onSuccess = { CreateCipherResult.Success },
|
||||
|
@ -797,7 +802,12 @@ class VaultRepositoryImpl(
|
|||
),
|
||||
)
|
||||
}
|
||||
.onSuccess { vaultDiskSource.saveCipher(userId = userId, cipher = it) }
|
||||
.onSuccess {
|
||||
vaultDiskSource.saveCipher(
|
||||
userId = userId,
|
||||
cipher = it.copy(collectionIds = collectionIds),
|
||||
)
|
||||
}
|
||||
.fold(
|
||||
onFailure = { ShareCipherResult.Error },
|
||||
onSuccess = { ShareCipherResult.Success },
|
||||
|
|
|
@ -1874,7 +1874,12 @@ class VaultRepositoryTest {
|
|||
),
|
||||
)
|
||||
} returns mockCipher.asSuccess()
|
||||
coEvery { vaultDiskSource.saveCipher(userId, mockCipher) } just runs
|
||||
coEvery {
|
||||
vaultDiskSource.saveCipher(
|
||||
userId,
|
||||
mockCipher.copy(collectionIds = listOf("mockId-1")),
|
||||
)
|
||||
} just runs
|
||||
|
||||
val result = vaultRepository.createCipherInOrganization(
|
||||
cipherView = mockCipherView,
|
||||
|
@ -2842,7 +2847,13 @@ class VaultRepositoryTest {
|
|||
),
|
||||
)
|
||||
} returns createMockCipher(number = 1).asSuccess()
|
||||
coEvery { vaultDiskSource.saveCipher(userId, createMockCipher(number = 1)) } just runs
|
||||
coEvery {
|
||||
vaultDiskSource.saveCipher(
|
||||
userId,
|
||||
createMockCipher(number = 1)
|
||||
.copy(collectionIds = listOf("mockId-1")),
|
||||
)
|
||||
} just runs
|
||||
|
||||
val result = vaultRepository.shareCipher(
|
||||
cipherId = "mockId-1",
|
||||
|
|
Loading…
Add table
Reference in a new issue