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:
Diffstat (limited to 'lib/Controller/PollApiController.php')
-rw-r--r--lib/Controller/PollApiController.php19
1 files changed, 19 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