Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nextcloud files instead of (old) file objects #185

Merged
merged 17 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
['name' => 'objects#revert', 'url' => 'api/objects/{objectType}/{id}/revert', 'verb' => 'POST'],
['name' => 'objects#getAuditTrail', 'url' => 'api/objects/{objectType}/{id}/audit', 'verb' => 'GET'],
['name' => 'objects#getRelations', 'url' => 'api/objects/{objectType}/{id}/relations', 'verb' => 'GET'],
['name' => 'objects#getUses', 'url' => 'api/objects/{objectType}/{id}/uses', 'verb' => 'GET']
['name' => 'objects#getUses', 'url' => 'api/objects/{objectType}/{id}/uses', 'verb' => 'GET'],
['name' => 'objects#getFiles', 'url' => 'api/objects/{objectType}/{id}/files', 'verb' => 'GET']
]
];
192 changes: 0 additions & 192 deletions lib/Controller/CatalogiController.php

This file was deleted.

22 changes: 22 additions & 0 deletions lib/Controller/ObjectsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,28 @@ public function getUses(string $objectType, string $id): JSONResponse
return new JSONResponse($uses);
}


/**
* Get all files associated with a specific object
*
* @NoAdminRequired
* @NoCSRFRequired
*
* @return JSONResponse
*/
public function getFiles(string $objectType, string $id): JSONResponse
{
try {
$files = $this->objectService->getFiles($objectType, $id);
return new JSONResponse($files);
} catch (Exception $e) {
return new JSONResponse(
['error' => $e->getMessage()],
400
);
}
}

/**
* Lock an object to prevent concurrent modifications
*
Expand Down
Loading