mirror of
https://github.com/nextcloud/tables.git
synced 2025-07-31 05:05:56 +00:00
enh(api): add API interface for managing tables (#170)
* refactor(integration): adjust widget rendering npm source Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * rebase * fix(permissions): show or hide action buttons related to the permissions from shared tables Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * rebase * enh(nav): add tutorial table if no tables are found for a user #155 Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * enh(cli): add more commands to manage tables from occ cli Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * rebase * chore(release): add changelog skeleton Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * enh(api): add API interface for managing tables including integration tests Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * enh(api): add API interface for managing table sharing including integration tests Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * enh(api): cleanup and update sql query counter because auf the new tests Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * enh(api): update sql query counter Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * enh(api): add API endpoint for columns - add API description - add API interface - refactor all effected methods to make them more straight forward - integration tests Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * enh(api): add API endpoint for rows - add API description - add API interface - some smaller code adjustments - integration tests Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * enh(api): add Integrations tab to the sidebar - add integrations tab to the sidebar - add integration to the menu in navigation for tables - small corresponding fixes Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * code cleanup Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * chore(test): update query count - new query count because of the new api tests Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * chore(api): update api doc Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * fix(error handling): add logging and return state for errors Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * fix(updat table): you can now update only the emoji for a table Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> * chore(cleanup): avoid else statements if not really needed Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> --------- Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com> Signed-off-by: Florian <florian.steffens@nextcloud.com>
This commit is contained in:
@ -27,6 +27,7 @@ use OCA\Tables\Errors\InternalError;
|
||||
use OCA\Tables\Errors\PermissionError;
|
||||
use OCA\Tables\Service\TableService;
|
||||
use OCP\DB\Exception;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@ -34,10 +35,12 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class RemoveTable extends Command {
|
||||
protected TableService $tableService;
|
||||
protected LoggerInterface $logger;
|
||||
|
||||
public function __construct(TableService $tableService) {
|
||||
public function __construct(TableService $tableService, LoggerInterface $logger) {
|
||||
parent::__construct();
|
||||
$this->tableService = $tableService;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
protected function configure(): void {
|
||||
@ -61,10 +64,12 @@ class RemoveTable extends Command {
|
||||
$id = $input->getArgument('ID');
|
||||
|
||||
try {
|
||||
$table = $this->tableService->delete($id, '');
|
||||
$this->tableService->delete($id, '');
|
||||
$output->writeln('Table deleted.');
|
||||
} catch (InternalError|PermissionError|Exception $e) {
|
||||
$output->writeln('Error occurred: '.$e->getMessage());
|
||||
$this->logger->warning('Following error occurred during executing occ command "'.self::class.'"', ['exception' => $e]);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user