summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-10-31 11:31:19 +0000
committerTom Needham <needham.thomas@gmail.com>2012-10-31 11:31:19 +0000
commit43917e187b91d8b235c37fa873de306f83e61b36 (patch)
tree4245a96b61ffa2bbbfeae2b3a265e17c1d2a88cc /apps/files_sharing
parentb2a1b54e9c24637032ea791da4da6e4d5914b5ba (diff)
downloadnextcloud-server-43917e187b91d8b235c37fa873de306f83e61b36.tar.gz
nextcloud-server-43917e187b91d8b235c37fa873de306f83e61b36.zip
External Share API: Move url down one level in response
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/appinfo/routes.php1
-rw-r--r--apps/files_sharing/lib/api.php3
-rw-r--r--apps/files_sharing/tests/api.php13
3 files changed, 15 insertions, 2 deletions
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 @@
+<?php
+/**
+ * Copyright (c) 2012 Tom Needhama <tom@owncloud.com>
+ * 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