Add includeTags to /share/id

This commit is contained in:
tobiasKaminsky 2022-09-19 11:11:09 +02:00
parent 3950deb42f
commit 4a4a3874da
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -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,6 +380,11 @@ class ShareAPIController extends OCSController {
try {
if ($this->canAccessShare($share)) {
$share = $this->formatShare($share);
if ($includeTags) {
$share = Helper::populateTags($formatted, 'file_source', \OC::$server->getTagManager());
}
return new DataResponse([$share]);
}
} catch (NotFoundException $e) {