(cmd: AddComment, context: AtomicContextManager)
| 53 | } |
| 54 | |
| 55 | pub fn add_comment(cmd: AddComment, context: AtomicContextManager) -> Future<ServiceResponse> { |
| 56 | Box::pin(async move { |
| 57 | let mut uow = |
| 58 | UnitOfWork::<Repository<BoardAggregate>>::new(context.clone()) |
| 59 | .await?; |
| 60 | |
| 61 | let mut board_aggregate = uow.repository().get(&cmd.board_id.to_string()).await?; |
| 62 | board_aggregate.add_comment(cmd); |
| 63 | uow.repository().update(&mut board_aggregate).await?; |
| 64 | uow.commit().await?; |
| 65 | Ok(().into()) |
| 66 | }) |
| 67 | } |
| 68 | |
| 69 | pub fn edit_comment( |
| 70 | cmd: EditComment, |
nothing calls this directly
no test coverage detected