(
cmd: EditComment,
context: AtomicContextManager,
)
| 67 | } |
| 68 | |
| 69 | pub fn edit_comment( |
| 70 | cmd: EditComment, |
| 71 | context: AtomicContextManager, |
| 72 | ) -> Future<ServiceResponse> { |
| 73 | Box::pin(async move { |
| 74 | let mut uow = |
| 75 | UnitOfWork::<Repository<BoardAggregate>>::new(context.clone()) |
| 76 | .await?; |
| 77 | |
| 78 | let mut board_aggregate = uow.repository().get(&cmd.board_id.to_string()).await?; |
| 79 | board_aggregate.edit_comment(cmd)?; |
| 80 | uow.repository().update(&mut board_aggregate).await?; |
| 81 | uow.commit().await?; |
| 82 | Ok(().into()) |
| 83 | }) |
| 84 | } |
| 85 | |
| 86 | pub fn handle_outbox(outbox: Outbox, context: AtomicContextManager) -> Future<ServiceResponse> { |
| 87 | Box::pin(async move { |
nothing calls this directly
no test coverage detected