mirror of
https://github.com/nextcloud/tables.git
synced 2026-01-17 13:31:56 +00:00
41 lines
953 B
PHP
41 lines
953 B
PHP
<?php
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace OCA\Tables\Controller;
|
|
|
|
use OCA\Tables\AppInfo\Application;
|
|
use OCA\Tables\Service\TableTemplateService;
|
|
use OCP\AppFramework\Controller;
|
|
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
|
use OCP\AppFramework\Http\DataResponse;
|
|
use OCP\IRequest;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
class TableTemplateController extends Controller {
|
|
private TableTemplateService $service;
|
|
|
|
protected LoggerInterface $logger;
|
|
|
|
use Errors;
|
|
|
|
public function __construct(
|
|
IRequest $request,
|
|
LoggerInterface $logger,
|
|
TableTemplateService $service) {
|
|
parent::__construct(Application::APP_ID, $request);
|
|
$this->logger = $logger;
|
|
$this->service = $service;
|
|
}
|
|
|
|
#[NoAdminRequired]
|
|
public function list(): DataResponse {
|
|
return $this->handleError(function () {
|
|
return $this->service->getTemplateList();
|
|
});
|
|
}
|
|
}
|