Skip to content

Commit 458b886

Browse files
blizzzenjeck
authored andcommitted
feat: add last modified information to response
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent 995dfc2 commit 458b886

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/Controller/Api1Controller.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,12 @@ public function indexTableRowsSimple(int $tableId, ?int $limit, ?int $offset): D
11461146
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT)]
11471147
public function indexTableRows(int $tableId, ?int $limit, ?int $offset): DataResponse {
11481148
try {
1149-
return new DataResponse($this->rowService->formatRows($this->rowService->findAllByTable($tableId, $this->userId, $limit, $offset)));
1149+
$rows = $this->rowService->findAllByTable($tableId, $this->userId, $limit, $offset);
1150+
$response = new DataResponse($this->rowService->formatRows($rows));
1151+
$table = $this->tableService->find($tableId);
1152+
$lastModified = new \DateTime($table->getLastEditAt());
1153+
$response->setLastModified($lastModified);
1154+
return $response;
11501155
} catch (PermissionError $e) {
11511156
$this->logger->warning('A permission error occurred: ' . $e->getMessage(), ['exception' => $e]);
11521157
$message = ['message' => $e->getMessage()];

0 commit comments

Comments
 (0)