From 4504d7f5e9f416d33946c3364426235c92222448 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 20 Jul 2016 10:44:52 +0200 Subject: [PATCH] DataResponse required ['data' => DATA] --- apps/files_sharing/lib/API/Share20OCS.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/files_sharing/lib/API/Share20OCS.php b/apps/files_sharing/lib/API/Share20OCS.php index aebda5d8512..7dee1c7b67c 100644 --- a/apps/files_sharing/lib/API/Share20OCS.php +++ b/apps/files_sharing/lib/API/Share20OCS.php @@ -203,7 +203,7 @@ class Share20OCS extends OCSController { if ($this->canAccessShare($share)) { try { $share = $this->formatShare($share); - return new DataResponse([$share]); + return new DataResponse(['data' => [$share]]); } catch (NotFoundException $e) { //Fall trough } @@ -240,7 +240,7 @@ class Share20OCS extends OCSController { $this->shareManager->deleteShare($share); - return new DataResponse([]); + return new DataResponse(); } /** @@ -339,7 +339,7 @@ class Share20OCS extends OCSController { */ $existingShares = $this->shareManager->getSharesBy($this->currentUser->getUID(), \OCP\Share::SHARE_TYPE_LINK, $path, false, 1, 0); if (!empty($existingShares)) { - return new DataResponse($this->formatShare($existingShares[0])); + return new DataResponse(['data' => $this->formatShare($existingShares[0])]); } $publicUpload = $this->request->getParam('publicUpload', null); @@ -391,7 +391,7 @@ class Share20OCS extends OCSController { $share->setSharedWith($shareWith); $share->setPermissions($permissions); } else { - throw new OCSBadRequestException($this->l->t('Unknown share type'); + throw new OCSBadRequestException($this->l->t('Unknown share type')); } $share->setShareType($shareType); @@ -408,7 +408,7 @@ class Share20OCS extends OCSController { $output = $this->formatShare($share); - return new DataResponse($output); + return new DataResponse(['data' => $output]); } /** @@ -432,7 +432,7 @@ class Share20OCS extends OCSController { } } - return new DataResponse($formatted); + return new DataResponse(['data' => $formatted]); } /** @@ -466,7 +466,7 @@ class Share20OCS extends OCSController { } } - return new DataResponse($formatted); + return new DataResponse(['data' => $formatted]); } /** @@ -537,7 +537,7 @@ class Share20OCS extends OCSController { } } - return new DataResponse($formatted); + return new DataResponse(['data' => $formatted]); } /** @@ -671,7 +671,7 @@ class Share20OCS extends OCSController { throw new OCSBadRequestException($e->getMessage()); } - return new DataResponse($this->formatShare($share)); + return new DataResponse(['data' => $this->formatShare($share)]); } /** -- 2.39.5