* Delete Dataset and all depending objects * * @param int $datasetId * @return DataResponse * @throws \OCP\DB\Exception */
(int $datasetId)
| 79 | * @throws \OCP\DB\Exception |
| 80 | */ |
| 81 | #[NoAdminRequired] |
| 82 | public function delete(int $datasetId) { |
| 83 | if ($this->DatasetService->isOwn($datasetId)) { |
| 84 | $reports = $this->ReportService->reportsForDataset($datasetId); |
| 85 | foreach ($reports as $report) { |
| 86 | $this->ReportService->delete((int)$report['id']); |
| 87 | } |
| 88 | $this->DatasetService->delete($datasetId); |
| 89 | return new DataResponse('true'); |
| 90 | } else { |
| 91 | return new DataResponse('false'); |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * get dataset details |
nothing calls this directly
no test coverage detected