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/SubscriptionController.php')
-rw-r--r--lib/Controller/SubscriptionController.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Controller/SubscriptionController.php b/lib/Controller/SubscriptionController.php
index f2517237..ea1e9e49 100644
--- a/lib/Controller/SubscriptionController.php
+++ b/lib/Controller/SubscriptionController.php
@@ -57,15 +57,16 @@ class SubscriptionController extends Controller {
/**
* Get subscription status
+ * @PublicPage
* @NoAdminRequired
* @param int $pollId
* @return DataResponse
* @throws DoesNotExistException
* @throws NotAuthorizedException
*/
- public function get($pollId) {
+ public function get($pollId, $token) {
try {
- return new DataResponse($this->subscriptionService->get($pollId), Http::STATUS_OK);
+ return new DataResponse($this->subscriptionService->get($pollId, $token), Http::STATUS_OK);
} catch (NotAuthorizedException $e) {
return new DataResponse(['error' => $e->getMessage()], $e->getStatus());
} catch (DoesNotExistException $e) {
@@ -75,15 +76,16 @@ class SubscriptionController extends Controller {
/**
* Switch subscription status
+ * @PublicPage
* @NoAdminRequired
* @param int $pollId
* @param int $subscribed
* @return DataResponse
* @throws NotAuthorizedException
*/
- public function set($pollId, $subscribed) {
+ public function set($pollId, $token, $subscribed) {
try {
- return new DataResponse($this->subscriptionService->set($pollId, $subscribed), Http::STATUS_OK);
+ return new DataResponse($this->subscriptionService->set($pollId, $token, $subscribed), Http::STATUS_OK);
} catch (NotAuthorizedException $e) {
return new DataResponse(['error' => $e->getMessage()], $e->getStatus());
}