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-07-26 20:35:11 +0300
committerdartcafe <github@dartcafe.de>2020-07-26 20:35:11 +0300
commite857f1450b8e916b675a907fe75f236ad5cd9c99 (patch)
treeab557dae7d3ce0a0a7643b043b13d35b47d6ceaf /lib/Controller
parent7dd22d2073fd7eef0be8f52c5979817add6cc1df (diff)
copy participants addresses to clipboard
Diffstat (limited to 'lib/Controller')
-rw-r--r--lib/Controller/PollApiController.php19
-rw-r--r--lib/Controller/PollController.php17
2 files changed, 36 insertions, 0 deletions
diff --git a/lib/Controller/PollApiController.php b/lib/Controller/PollApiController.php
index 20eb2ea0..c2e4750f 100644
--- a/lib/Controller/PollApiController.php
+++ b/lib/Controller/PollApiController.php
@@ -203,6 +203,25 @@
}
/**
+ * Collect email addresses from particitipants
+ * @NoAdminRequired
+ * @CORS
+ * @NoCSRFRequired
+ * @param Array $poll
+ * @return DataResponse
+ */
+
+ public function getParticipantsEmailAddresses($pollId) {
+ try {
+ return new DataResponse($this->pollService->getParticipantsEmailAddresses($pollId), Http::STATUS_OK);
+ } catch (DoesNotExistException $e) {
+ return new DataResponse(['error' => 'Poll not found'], Http::STATUS_NOT_FOUND);
+ } catch (NotAuthorizedException $e) {
+ return new DataResponse(['error' => $e->getMessage()], $e->getStatus());
+ }
+ }
+
+ /**
* Get valid values for configuration options
* @NoAdminRequired
* @CORS
diff --git a/lib/Controller/PollController.php b/lib/Controller/PollController.php
index d1b4945b..04445482 100644
--- a/lib/Controller/PollController.php
+++ b/lib/Controller/PollController.php
@@ -267,4 +267,21 @@ class PollController extends Controller {
}
}
+ /**
+ * Collect email addresses from particitipants
+ * @NoAdminRequired
+ * @param Array $poll
+ * @return DataResponse
+ */
+
+ public function getParticipantsEmailAddresses($pollId) {
+ try {
+ return new DataResponse($this->pollService->getParticipantsEmailAddresses($pollId), Http::STATUS_OK);
+ } catch (DoesNotExistException $e) {
+ return new DataResponse(['error' => 'Poll not found'], Http::STATUS_NOT_FOUND);
+ } catch (NotAuthorizedException $e) {
+ return new DataResponse(['error' => $e->getMessage()], $e->getStatus());
+ }
+ }
+
}