MCPcopy Create free account
hub / github.com/Migorithm/rustiful-backend / add_comment

Method add_comment

library/src/services/handlers.rs:55–67  ·  view source on GitHub ↗
(cmd: AddComment, context: AtomicContextManager)

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 4

repositoryMethod · 0.80
getMethod · 0.45
updateMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected