From 458b886eb80a7b5a35e94ba4be19a54a207e8729 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 19 Jun 2025 14:36:39 +0200 Subject: [PATCH] feat: add last modified information to response Signed-off-by: Arthur Schiwon --- lib/Controller/Api1Controller.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Controller/Api1Controller.php b/lib/Controller/Api1Controller.php index 75517dc7e8..9b4ac4d6c7 100644 --- a/lib/Controller/Api1Controller.php +++ b/lib/Controller/Api1Controller.php @@ -1146,7 +1146,12 @@ public function indexTableRowsSimple(int $tableId, ?int $limit, ?int $offset): D #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT)] public function indexTableRows(int $tableId, ?int $limit, ?int $offset): DataResponse { try { - return new DataResponse($this->rowService->formatRows($this->rowService->findAllByTable($tableId, $this->userId, $limit, $offset))); + $rows = $this->rowService->findAllByTable($tableId, $this->userId, $limit, $offset); + $response = new DataResponse($this->rowService->formatRows($rows)); + $table = $this->tableService->find($tableId); + $lastModified = new \DateTime($table->getLastEditAt()); + $response->setLastModified($lastModified); + return $response; } catch (PermissionError $e) { $this->logger->warning('A permission error occurred: ' . $e->getMessage(), ['exception' => $e]); $message = ['message' => $e->getMessage()];