Skip to content

Commit

Permalink
PIN-4337-2: Fix UserRemoved event handling in projection (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
galales authored Dec 19, 2023
1 parent a45cb28 commit 1bc9c00
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ object ClientCqrsProjection {
collection.updateOne(Filters.eq("data.id", c.id.toString), _),
Updates.push("data.users", rId.toString)
)
case UserRemoved(cId, rId) =>
ActionWithBson(collection.updateOne(Filters.eq("data.id", cId), _), Updates.pull("data.users", rId.toString))
case UserRemoved(c, rId) =>
ActionWithBson(
collection.updateOne(Filters.eq("data.id", c.id.toString), _),
Updates.pull("data.users", rId.toString)
)
case ClientPurposeAdded(cId, states) =>
// Added as array instead of map because it is not possible to update objects without knowing their key
ActionWithBson(
Expand Down

0 comments on commit 1bc9c00

Please sign in to comment.