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-10-23 17:56:11 +0300
committerdartcafe <github@dartcafe.de>2020-10-23 17:56:11 +0300
commit622133324f3eb107cd9a425759a50917973925b7 (patch)
treefb50b1944771d3f2ad88397d6816caeeaa8dd558 /lib/Controller/SubscriptionController.php
parent81943fe7e2a8b7f9ea191297bb471e6f0afab78e (diff)
avoid console error, when not subscribed
Diffstat (limited to 'lib/Controller/SubscriptionController.php')
-rw-r--r--lib/Controller/SubscriptionController.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Controller/SubscriptionController.php b/lib/Controller/SubscriptionController.php
index 5e5025d1..edd1107c 100644
--- a/lib/Controller/SubscriptionController.php
+++ b/lib/Controller/SubscriptionController.php
@@ -65,11 +65,11 @@ class SubscriptionController extends Controller {
*/
public function get($pollId, $token) {
try {
- return new DataResponse($this->subscriptionService->get($pollId, $token), Http::STATUS_OK);
+ return new DataResponse(['subscribed' => $this->subscriptionService->get($pollId, $token)], Http::STATUS_OK);
} catch (NotAuthorizedException $e) {
return new DataResponse(['error' => $e->getMessage()], $e->getStatus());
} catch (DoesNotExistException $e) {
- return new DataResponse(['status' => 'Not subscribed'], Http::STATUS_NOT_FOUND);
+ return new DataResponse(['subscribed' => false], Http::STATUS_OK);
}
}