diff options
author | dartcafe <github@dartcafe.de> | 2020-10-23 17:56:11 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-10-23 17:56:11 +0300 |
commit | 622133324f3eb107cd9a425759a50917973925b7 (patch) | |
tree | fb50b1944771d3f2ad88397d6816caeeaa8dd558 /lib/Controller/SubscriptionController.php | |
parent | 81943fe7e2a8b7f9ea191297bb471e6f0afab78e (diff) |
avoid console error, when not subscribed
Diffstat (limited to 'lib/Controller/SubscriptionController.php')
-rw-r--r-- | lib/Controller/SubscriptionController.php | 4 |
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); } } |