Skip to content

Commit

Permalink
Merge pull request #536 from eikek/fix/update-alias
Browse files Browse the repository at this point in the history
Fix updating alias with existing members
  • Loading branch information
mergify[bot] authored Aug 11, 2021
2 parents 02487e4 + ea81004 commit 6f3cea3
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 6f3cea3

Please sign in to comment.