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
path: root/lib
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2020-09-01 01:09:19 +0300
committerdartcafe <github@dartcafe.de>2020-09-01 01:09:19 +0300
commit8106e1b488c2243746ec5d39700bbbab1f7a250a (patch)
tree56d97520e742dba5f94afe25a17c8d2c59c66fc8 /lib
parent46678428e6dcfd422712f9a89415523f478ae10d (diff)
some fixes
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/PollApiController.php2
-rw-r--r--lib/Controller/ShareApiController.php2
-rw-r--r--lib/Controller/SubscriptionApiController.php6
-rw-r--r--lib/Model/Acl.php2
-rw-r--r--lib/Service/PollService.php2
-rw-r--r--lib/Service/VoteService.php5
6 files changed, 10 insertions, 9 deletions
diff --git a/lib/Controller/PollApiController.php b/lib/Controller/PollApiController.php
index c2e4750f..c9cdc174 100644
--- a/lib/Controller/PollApiController.php
+++ b/lib/Controller/PollApiController.php
@@ -90,7 +90,7 @@
*/
public function get($pollId) {
try {
- return new DataResponse(['poll' => $this->pollService->get($pollId)], Http::STATUS_OK);
+ return new DataResponse(['poll' => $this->pollService->get($pollId, '')], Http::STATUS_OK);
} catch (DoesNotExistException $e) {
return new DataResponse(['error' => 'Not found'], Http::STATUS_NOT_FOUND);
} catch (NotAuthorizedException $e) {
diff --git a/lib/Controller/ShareApiController.php b/lib/Controller/ShareApiController.php
index 57c65033..5ffe1a63 100644
--- a/lib/Controller/ShareApiController.php
+++ b/lib/Controller/ShareApiController.php
@@ -76,7 +76,7 @@ class ShareApiController extends ApiController {
*/
public function list($pollId) {
try {
- return new DataResponse(['shares' => $this->shareService->list($pollId)], Http::STATUS_OK);
+ return new DataResponse(['shares' => $this->shareService->list($pollId, '')], Http::STATUS_OK);
} catch (DoesNotExistException $e) {
return new DataResponse(['error' => 'No shares for poll with id ' . $pollId . ' not found'], Http::STATUS_NOT_FOUND);
} catch (NotAuthorizedException $e) {
diff --git a/lib/Controller/SubscriptionApiController.php b/lib/Controller/SubscriptionApiController.php
index b8a87d16..84936691 100644
--- a/lib/Controller/SubscriptionApiController.php
+++ b/lib/Controller/SubscriptionApiController.php
@@ -73,7 +73,7 @@ class SubscriptionApiController extends ApiController {
*/
public function get($pollId) {
try {
- $this->subscriptionService->get($pollId);
+ $this->subscriptionService->get($pollId, '');
return new DataResponse(['status' => 'Subscribed to poll ' . $pollId], Http::STATUS_OK);
} catch (DoesNotExistException $e) {
return new DataResponse(['status' => 'Not subscribed to poll ' . $pollId], Http::STATUS_NOT_FOUND);
@@ -92,7 +92,7 @@ class SubscriptionApiController extends ApiController {
*/
public function subscribe($pollId) {
try {
- $this->subscriptionService->set($pollId, true);
+ $this->subscriptionService->set($pollId, '', true);
return new DataResponse(['status' => 'Subscribed to poll ' . $pollId], Http::STATUS_OK);
} catch (NotAuthorizedException $e) {
return new DataResponse(['error' => $e->getMessage()], $e->getStatus());
@@ -108,7 +108,7 @@ class SubscriptionApiController extends ApiController {
*/
public function unsubscribe($pollId) {
try {
- $this->subscriptionService->set($pollId, false);
+ $this->subscriptionService->set($pollId, '', false);
return new DataResponse(['status' => 'Unsubscribed from poll ' . $pollId], Http::STATUS_OK);
} catch (NotAuthorizedException $e) {
return new DataResponse(['error' => $e->getMessage()], $e->getStatus());
diff --git a/lib/Model/Acl.php b/lib/Model/Acl.php
index 86743c67..b68386f0 100644
--- a/lib/Model/Acl.php
+++ b/lib/Model/Acl.php
@@ -141,7 +141,7 @@ class Acl implements JsonSerializable {
$this->pollId = $this->share->getPollId();
} elseif ($pollId) {
- $this->user = \OC::$server->getUserSession()->getUser()->getUID();
+ $this->userId = \OC::$server->getUserSession()->getUser()->getUID();
$this->pollId = $pollId;
$this->share = null;
}
diff --git a/lib/Service/PollService.php b/lib/Service/PollService.php
index b9fdbdef..f694853a 100644
--- a/lib/Service/PollService.php
+++ b/lib/Service/PollService.php
@@ -313,7 +313,7 @@ class PollService {
* Collect email addresses from particitipants
* @NoAdminRequired
* @param Array $poll
- * @return DataResponse
+ * @return array
*/
public function getParticipantsEmailAddresses($pollId) {
diff --git a/lib/Service/VoteService.php b/lib/Service/VoteService.php
index cbedb1ad..26f70502 100644
--- a/lib/Service/VoteService.php
+++ b/lib/Service/VoteService.php
@@ -151,7 +151,7 @@ class VoteService {
* @param int $voteId
* @param string $userId
* @param int $pollId
- * @return Vote
+ * @return boolean
* @throws NotAuthorizedException
*/
public function delete($pollId, $userId) {
@@ -160,7 +160,8 @@ class VoteService {
throw new NotAuthorizedException;
}
- $votes = $this->voteMapper->deleteByPollAndUser($pollId, $userId);
+ $this->voteMapper->deleteByPollAndUser($pollId, $userId);
+ return true;
}
}