External Share API: Move url down one level in response

remotes/origin/stable5
Tom Needham 13 years ago
parent b2a1b54e9c
commit 43917e187b
  1. 1
      apps/files_sharing/appinfo/routes.php
  2. 3
      apps/files_sharing/lib/api.php
  3. 13
      apps/files_sharing/tests/api.php
  4. 1
      apps2

@ -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' => '.*'));
?>

@ -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;
}

@ -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
}

@ -0,0 +1 @@
Subproject commit 5108f1f8c21117c164ca0627b22f322a5725154d
Loading…
Cancel
Save