tmail-backend icon indicating copy to clipboard operation
tmail-backend copied to clipboard

[PublicAsset] Implement updateIdentityIds method for PublicAssetRepository

Open vttranlina opened this issue 8 months ago • 3 comments

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?

vttranlina avatar May 28 '24 07:05 vttranlina