Skip to content

Commit 8c5ea00

Browse files
committed
FIX: Голосование в опросе
1 parent b678d09 commit 8c5ea00

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

app/Controllers/Poll/PollController.php

+21-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ class PollController extends Controller
1717

1818
protected $limit = 15;
1919

20+
/**
21+
* All surveys for a specific user
22+
* Все опросы для конкретного пользователя
23+
*
24+
* @return void
25+
*/
2026
public function index()
2127
{
2228
$polls = PollModel::getUserQuestionsPolls(Html::pageNumber(), $this->limit);
@@ -36,6 +42,12 @@ public function index()
3642
);
3743
}
3844

45+
/**
46+
* View the survey
47+
* Просмотр опроса
48+
*
49+
* @return void
50+
*/
3951
public function poll()
4052
{
4153
$id = Request::param('id')->asInt();
@@ -52,11 +64,19 @@ public function poll()
5264
);
5365
}
5466

67+
/**
68+
* Choosing an option in the survey
69+
* Выбор варианта в опросе
70+
*
71+
* @return void
72+
*/
5573
public function vote()
5674
{
5775
$question_id = Request::post('question_id')->asInt();
5876
$answer_id = Request::post('answer_id')->asInt();
5977

60-
return PollModel::vote($question_id, $answer_id);
78+
PollModel::vote($question_id, $answer_id);
79+
80+
return true;
6181
}
6282
}

0 commit comments

Comments
 (0)