fix: honest review update rollback test, goal delete NotFound fake, read before write
This commit is contained in:
@@ -50,7 +50,11 @@ impl GoalCommand for InMemoryStore {
|
||||
_user_id: &UserId,
|
||||
events: &[DomainEvent],
|
||||
) -> Result<(), DomainError> {
|
||||
self.goals.write().unwrap().remove(&id.value());
|
||||
self.goals
|
||||
.write()
|
||||
.unwrap()
|
||||
.remove(&id.value())
|
||||
.ok_or_else(|| DomainError::NotFound("Goal not found".into()))?;
|
||||
self.record_events(events);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user