diff options
author | dartcafe <github@dartcafe.de> | 2020-06-22 21:43:42 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-06-22 21:43:42 +0300 |
commit | 17c03b27e1e0efe74817b3ce622f773a8291bcfd (patch) | |
tree | c840c7d445c96c6c3d37661e38e8cce44edb5d21 /lib/Controller | |
parent | 863d50ecfa2963664cb16892d31af65ad3289b5e (diff) |
code maintenance
Diffstat (limited to 'lib/Controller')
-rw-r--r-- | lib/Controller/CommentApiController.php | 3 | ||||
-rw-r--r-- | lib/Controller/OptionController.php | 2 | ||||
-rw-r--r-- | lib/Controller/ShareController.php | 2 | ||||
-rw-r--r-- | lib/Controller/SubscriptionController.php | 2 |
4 files changed, 4 insertions, 5 deletions
diff --git a/lib/Controller/CommentApiController.php b/lib/Controller/CommentApiController.php index 9d6fc1a8..ad09654d 100644 --- a/lib/Controller/CommentApiController.php +++ b/lib/Controller/CommentApiController.php @@ -109,8 +109,7 @@ class CommentApiController extends ApiController { */ public function delete($commentId) { try { - $this->commentService->delete($commentId); - return new DataResponse($commentId, Http::STATUS_OK); + return new DataResponse($this->commentService->delete($commentId), Http::STATUS_OK); } catch (DoesNotExistException $e) { return new DataResponse(['error' => 'Comment does not exist'], Http::STATUS_NOT_FOUND); } catch (NotAuthorizedException $e) { diff --git a/lib/Controller/OptionController.php b/lib/Controller/OptionController.php index ae58c135..0ec24092 100644 --- a/lib/Controller/OptionController.php +++ b/lib/Controller/OptionController.php @@ -94,7 +94,7 @@ class OptionController extends Controller { * Update poll option * @NoAdminRequired * @NoCSRFRequired - * @param Option $option + * @param array $option * @return DataResponse */ public function update($option) { diff --git a/lib/Controller/ShareController.php b/lib/Controller/ShareController.php index 16d9bca3..aa80cc3d 100644 --- a/lib/Controller/ShareController.php +++ b/lib/Controller/ShareController.php @@ -109,7 +109,7 @@ class ShareController extends Controller { } catch (NotAuthorizedException $e) { return new DataResponse(['error' => $e->getMessage()], $e->getStatus()); } catch (InvalidUsername $e) { - return new DataResponse($userName . ' is not valid', Http::STATUS_CONFLICT); + return new DataResponse(['error' => $userName . ' is not valid'], Http::STATUS_CONFLICT); } catch (DoesNotExistException $e) { // return forbidden in all not catched error cases return new DataResponse($e, Http::STATUS_FORBIDDEN); diff --git a/lib/Controller/SubscriptionController.php b/lib/Controller/SubscriptionController.php index 194b97e6..e90f4a66 100644 --- a/lib/Controller/SubscriptionController.php +++ b/lib/Controller/SubscriptionController.php @@ -76,7 +76,7 @@ class SubscriptionController extends Controller { } catch (NotAuthorizedException $e) { return new DataResponse(['error' => $e->getMessage()], $e->getStatus()); } catch (DoesNotExistException $e) { - return new DataResponse(['error' => 'Not subscribed'], Http::STATUS_NOT_FOUND); + return new DataResponse(['status' => 'Not subscribed'], Http::STATUS_NOT_FOUND); } } |