handle($id); $this->view->chapter = $chapter; } /** * @Get("/{id:[0-9]+}/comments", name="web.chapter.comments") */ public function commentsAction($id) { $service = new ChapterCommentListService(); $comments = $service->handle($id); return $this->jsonSuccess(['comments' => $comments]); } /** * @Post("/{id:[0-9]+}/agree", name="web.chapter.agree") */ public function agreeAction($id) { $service = new ChapterAgreeVoteService(); $service->handle($id); return $this->jsonSuccess(); } /** * @Post("/{id:[0-9]+}/oppose", name="web.chapter.oppose") */ public function opposeAction($id) { $service = new ChapterOpposeVoteService(); $service->handle($id); return $this->jsonSuccess(); } }