|
|
|
|
@ -67,6 +67,7 @@ class ApiController extends Controller {
|
|
|
|
|
*
|
|
|
|
|
* @param string $path path
|
|
|
|
|
* @param array $tags array of tags
|
|
|
|
|
* @return DataResponse
|
|
|
|
|
*/
|
|
|
|
|
public function updateFileTags($path, $tags = null) {
|
|
|
|
|
$result = array();
|
|
|
|
|
@ -76,6 +77,10 @@ class ApiController extends Controller {
|
|
|
|
|
$this->tagService->updateFileTags($path, $tags);
|
|
|
|
|
} catch (\OCP\Files\NotFoundException $e) {
|
|
|
|
|
return new DataResponse($e->getMessage(), Http::STATUS_NOT_FOUND);
|
|
|
|
|
} catch (\OCP\Files\StorageNotAvailableException $e) {
|
|
|
|
|
return new DataResponse($e->getMessage(), Http::STATUS_SERVICE_UNAVAILABLE);
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
return new DataResponse($e->getMessage(), Http::STATUS_NOT_FOUND);
|
|
|
|
|
}
|
|
|
|
|
$result['tags'] = $tags;
|
|
|
|
|
}
|
|
|
|
|
@ -89,6 +94,7 @@ class ApiController extends Controller {
|
|
|
|
|
* @CORS
|
|
|
|
|
*
|
|
|
|
|
* @param array $tagName tag name to filter by
|
|
|
|
|
* @return DataResponse
|
|
|
|
|
*/
|
|
|
|
|
public function getFilesByTag($tagName) {
|
|
|
|
|
$files = array();
|
|
|
|
|
|