diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-09-22 11:23:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-22 11:23:48 +0300 |
commit | 938bc57f6dd0d4e6f152692926856263dacc06dd (patch) | |
tree | bf90fa706833ecf39501ade054face92f2ea3cf6 /apps | |
parent | e346417067103f449fa4c8f83d371d84a013faee (diff) | |
parent | 5b3fb7a8ffccfddb5eaba2dcef9f974f066a6d44 (diff) |
Merge pull request #34133 from nextcloud/showTag
Add includeTags to /share/id
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 12 |
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 |