tmail-backend
tmail-backend copied to clipboard
[PublicAsset] Implement updateIdentityIds method for PublicAssetRepository
It can help us update partial identities without resetting them. The method was introduced at pr https://github.com/linagora/tmail-backend/pull/1063
with default impl:
def updateIdentityIds(username: Username, id: PublicAssetId, identityIdsToAdd: Seq[IdentityId], identityIdsToRemove: Seq[IdentityId]): Publisher[Void] =
SMono(get(username, id))
.map(publicAsset => (publicAsset.identityIds.toSet ++ identityIdsToAdd.toSet) -- identityIdsToRemove.toSet)
.flatMap(identityIds => SMono(update(username, id, identityIds)))
We can override it for Cassandra, PostgreSQL impl?