Skip to content

Commit

Permalink
Fix updating alias with existing members
Browse files Browse the repository at this point in the history
  • Loading branch information
eikek committed Aug 11, 2021
1 parent 02487e4 commit ea81004
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ object OAlias {
detail: AliasInput
): F[AddResult] = {
val doUpdate = for {
_ <- RAliasMember.deleteForAlias(aliasId)
n <- RAlias.update(aliasId, accId, detail.alias)
k <-
if (n > 0) RAliasMember.updateForAlias(aliasId, detail.members)
else 0.pure[ConnectionIO]
if (n > 0) RAliasMember.insertForAlias(detail.alias.id, detail.members)
else RAliasMember.insertForAlias(aliasId, detail.members)
} yield n + k

for {
Expand Down

0 comments on commit ea81004

Please sign in to comment.