]> source.dussan.org Git - nextcloud-server.git/commitdiff
DataResponse required ['data' => DATA]
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 20 Jul 2016 08:44:52 +0000 (10:44 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Fri, 5 Aug 2016 12:17:31 +0000 (14:17 +0200)
apps/files_sharing/lib/API/Share20OCS.php

index aebda5d85129ed0567bf170ee29edc48d80b9d9c..7dee1c7b67cc30da3f8e788891fb0db4bf544fc8 100644 (file)
@@ -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)]);
        }
 
        /**