Skip to content

Commit

Permalink
Fixed Handlers in doobie cqrs
Browse files Browse the repository at this point in the history
  • Loading branch information
hnaderi committed Nov 14, 2023
1 parent 930c502 commit 80dbf9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/doobie/src/main/scala/DoobieCQRSRepository.scala
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ private final class DoobieCQRSRepository[F[_]: Concurrent: Clock, S, N](
.fromFoldable(events.map((_, ctx.address, now, ctx.metadata)))
.fold(FC.unit)(n => o.insertAll(n.toList).assertInserted(n.size))

_ <- NonEmptyChain.fromChain(events).fold(FC.unit)(handler)

_ <- cmds.insert(ctx).run.assertInserted

} yield ()
Expand Down

0 comments on commit 80dbf9b

Please sign in to comment.