Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-09-22 11:23:48 +0300
committerGitHub <noreply@github.com>2022-09-22 11:23:48 +0300
commit938bc57f6dd0d4e6f152692926856263dacc06dd (patch)
treebf90fa706833ecf39501ade054face92f2ea3cf6
parente346417067103f449fa4c8f83d371d84a013faee (diff)
parent5b3fb7a8ffccfddb5eaba2dcef9f974f066a6d44 (diff)
Merge pull request #34133 from nextcloud/showTag
Add includeTags to /share/id
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 003d9336af5..d795318cb8b 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -366,10 +366,11 @@ class ShareAPIController extends OCSController {
* @NoAdminRequired
*
* @param string $id
+ * @param bool $includeTags
* @return DataResponse
* @throws OCSNotFoundException
*/
- public function getShare(string $id): DataResponse {
+ public function getShare(string $id, bool $includeTags = false): DataResponse {
try {
$share = $this->getShareById($id);
} catch (ShareNotFound $e) {
@@ -379,7 +380,14 @@ class ShareAPIController extends OCSController {
try {
if ($this->canAccessShare($share)) {
$share = $this->formatShare($share);
- return new DataResponse([$share]);
+
+ if ($includeTags) {
+ $share = Helper::populateTags([$share], 'file_source', \OC::$server->getTagManager());
+ } else {
+ $share = [$share];
+ }
+
+ return new DataResponse($share);
}
} catch (NotFoundException $e) {
// Fall through