(&mut self, cmd: EditBoard)
| 33 | })) |
| 34 | } |
| 35 | pub fn update_board(&mut self, cmd: EditBoard) { |
| 36 | if let Some(ref title) = cmd.title { |
| 37 | self.board.title = title.clone(); |
| 38 | } |
| 39 | if let Some(ref content) = cmd.content { |
| 40 | self.board.content = content.clone(); |
| 41 | } |
| 42 | if let Some(ref state) = cmd.state { |
| 43 | self.board.state = state.clone() |
| 44 | } |
| 45 | self.raise_event(Box::new(BoardUpdated { |
| 46 | id: self.board.id, |
| 47 | title: cmd.title, |
| 48 | content: cmd.content, |
| 49 | state: cmd.state, |
| 50 | })) |
| 51 | } |
| 52 | pub fn add_comment(&mut self, cmd: AddComment) { |
| 53 | let new_comment = Comment::new(self.board.id, cmd.author, &cmd.content); |
| 54 | self.raise_event(Box::new(BoardCommentAdded { |
no outgoing calls