Merge pull request #10279 from appwrite/fix-document-audit-resource-path

Fix: wrong resource path for audits
This commit is contained in:
Jake Barnby 2025-08-08 22:11:15 +12:00 committed by GitHub
commit f154b1e8aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -106,8 +106,12 @@ class XList extends Action
]);
$audit = new Audit($dbForProject);
// getContext() => `document` or `row`.
$resource = 'database/' . $databaseId . '/collection/' . $collectionId . '/' .$this->getContext(). '/' . $document->getId();
// returns what we want, ignore the naming!
$type = $this->getCollectionsEventsContext();
$item = $this->getContext() === ROWS ? 'row' : 'document';
$resource = "database/$databaseId/$type/{$collectionId}/$item/{$document->getId()}";
$logs = $audit->getLogsByResource($resource, $queries);
$output = [];