diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php index f8ae29bd3e..f464eb6ae6 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php @@ -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 = [];