Skip to content

Commit 0af84d9

Browse files
committed
feat: add last modified information to response
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent 9a7bd18 commit 0af84d9

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
@@ -1084,7 +1084,12 @@ public function indexTableRowsSimple(int $tableId, ?int $limit, ?int $offset): D
10841084
#[RequirePermission(permission: Application::PERMISSION_READ, type: Application::NODE_TYPE_TABLE, idParam: 'tableId')]
10851085
public function indexTableRows(int $tableId, ?int $limit, ?int $offset): DataResponse {
10861086
try {
1087-
return new DataResponse($this->rowService->formatRows($this->rowService->findAllByTable($tableId, $this->userId, $limit, $offset)));
1087+
$rows = $this->rowService->findAllByTable($tableId, $this->userId, $limit, $offset);
1088+
$response = new DataResponse($this->rowService->formatRows($rows));
1089+
$table = $this->tableService->find($tableId);
1090+
$lastModified = new \DateTime($table->getLastEditAt());
1091+
$response->setLastModified($lastModified);
1092+
return $response;
10881093
} catch (PermissionError $e) {
10891094
$this->logger->warning('A permission error occurred: ' . $e->getMessage(), ['exception' => $e]);
10901095
$message = ['message' => $e->getMessage()];

0 commit comments

Comments
 (0)