diff options
Diffstat (limited to 'core/Controller/ReferenceApiController.php')
-rw-r--r-- | core/Controller/ReferenceApiController.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/core/Controller/ReferenceApiController.php b/core/Controller/ReferenceApiController.php index 098940187a8..9c3a212e8d7 100644 --- a/core/Controller/ReferenceApiController.php +++ b/core/Controller/ReferenceApiController.php @@ -31,10 +31,15 @@ use OCP\IRequest; class ReferenceApiController extends \OCP\AppFramework\OCSController { private IReferenceManager $referenceManager; + private ?string $userId; - public function __construct(string $appName, IRequest $request, IReferenceManager $referenceManager) { + public function __construct(string $appName, + IRequest $request, + IReferenceManager $referenceManager, + ?string $userId) { parent::__construct($appName, $request); $this->referenceManager = $referenceManager; + $this->userId = $userId; } /** @@ -102,4 +107,17 @@ class ReferenceApiController extends \OCP\AppFramework\OCSController { }, $providers); return new DataResponse($jsonProviders); } + + /** + * @NoAdminRequired + * + * @param string $providerId + * @return DataResponse + */ + public function touchProvider(string $providerId, ?int $timestamp = null): DataResponse { + if ($this->userId !== null) { + $this->referenceManager->touchProvider($this->userId, $providerId, $timestamp); + } + return new DataResponse(['success' => true]); + } } |