From 43917e187b91d8b235c37fa873de306f83e61b36 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Wed, 31 Oct 2012 11:31:19 +0000 Subject: [PATCH] External Share API: Move url down one level in response --- apps/files_sharing/appinfo/routes.php | 1 - apps/files_sharing/lib/api.php | 3 ++- apps/files_sharing/tests/api.php | 13 +++++++++++++ apps2 | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 apps/files_sharing/tests/api.php create mode 160000 apps2 diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php index d10607aa600..180dde635ad 100644 --- a/apps/files_sharing/appinfo/routes.php +++ b/apps/files_sharing/appinfo/routes.php @@ -20,5 +20,4 @@ * */ OCP\API::register('post', '/cloud/files/share/{type}/{path}', array('OC_Sharing_API', 'shareFile'), 'files_sharing', OC_API::USER_AUTH, array(), array('type' => 'user|group|link|email|contact|remote', 'path' => '.*')); - ?> \ No newline at end of file diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php index b450b359a4b..151e6d6cfd4 100644 --- a/apps/files_sharing/lib/api.php +++ b/apps/files_sharing/lib/api.php @@ -37,7 +37,8 @@ class OC_Sharing_API { } switch($type){ case OCP\Share::SHARE_TYPE_LINK: - return array('url' => OC_Helper::linkToPublic('files') . '&file=/' . OC_User::getUser() . '/files' . $path); + $link = OC_Helper::linkToPublic('files') . '&file=/' . OC_User::getUser() . '/files' . $path; + return array('link' => array('url' => $link)); break; } diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php new file mode 100644 index 00000000000..65d4b87089c --- /dev/null +++ b/apps/files_sharing/tests/api.php @@ -0,0 +1,13 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +class Test_Share_API extends UnitTestCase { + + function test + +} \ No newline at end of file diff --git a/apps2 b/apps2 new file mode 160000 index 00000000000..5108f1f8c21 --- /dev/null +++ b/apps2 @@ -0,0 +1 @@ +Subproject commit 5108f1f8c21117c164ca0627b22f322a5725154d