Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2020-06-21 19:55:23 +0300
committerdartcafe <github@dartcafe.de>2020-06-21 19:55:23 +0300
commit0d632d59b202f55da389db28b870b8c64416c00f (patch)
tree36d282c7642fd6a3da1d9cbb445939e72aa10b56 /lib/Controller
parent9f98851cf5fc5a1bc6811c9d432e8c0464b9763d (diff)
fixes and some code polish
Diffstat (limited to 'lib/Controller')
-rw-r--r--lib/Controller/PollController.php2
-rw-r--r--lib/Controller/VoteController.php6
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/Controller/PollController.php b/lib/Controller/PollController.php
index 89446ee0..c30c8c32 100644
--- a/lib/Controller/PollController.php
+++ b/lib/Controller/PollController.php
@@ -86,6 +86,7 @@ use OCA\Polls\Service\PollService;
* get
* @NoAdminRequired
* @NoCSRFRequired
+ * @PublicPage
* @param integer $pollId
* @return array
*/
@@ -165,7 +166,6 @@ use OCA\Polls\Service\PollService;
*/
public function update($pollId, $poll) {
- $this->logger->alert(json_encode($poll));
try {
return new DataResponse($this->pollService->update($pollId, $poll), Http::STATUS_OK);
} catch (DoesNotExistException $e) {
diff --git a/lib/Controller/VoteController.php b/lib/Controller/VoteController.php
index 7205c14f..64dc8501 100644
--- a/lib/Controller/VoteController.php
+++ b/lib/Controller/VoteController.php
@@ -26,6 +26,7 @@ namespace OCA\Polls\Controller;
// use Exception;
use OCP\AppFramework\Db\DoesNotExistException;
+use OCP\ILogger;
use OCP\IRequest;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
@@ -37,6 +38,7 @@ use OCA\Polls\Service\VoteService;
class VoteController extends Controller {
private $voteService;
+ private $logger;
/**
* VoteController constructor.
@@ -48,10 +50,12 @@ class VoteController extends Controller {
*/
public function __construct(
string $appName,
+ ILogger $logger,
IRequest $request,
VoteService $voteService
) {
parent::__construct($appName, $request);
+ $this->logger = $logger;
$this->voteService = $voteService;
}
@@ -129,7 +133,7 @@ class VoteController extends Controller {
*/
public function setByToken($option, $setTo, $token) {
try {
- return new DataResponse($this->voteService->set(null, $option['pollOptionText'], $setTo, $token), Http::STATUS_OK);
+ return new DataResponse($this->voteService->set(0, $option['pollOptionText'], $setTo, $token), Http::STATUS_OK);
} catch (NotAuthorizedException $e) {
return new DataResponse('Unauthorized', Http::STATUS_FORBIDDEN);
} catch (DoesNotExistException $e) {