diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php index 3a4de7e03c..1341edd1a9 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php @@ -103,8 +103,16 @@ class XList extends Action ]); $audit = new Audit($dbForProject); - $prefix = $this->getContext() === TABLES ? 'grid/' : ''; - $resource = "database/$databaseId/$prefix{$this->getContext()}/$collectionId"; + + $context = $this->getContext(); + $isTables = $context === TABLES; + + if (!$isTables) { + $resource = "database/$databaseId/$context/$collectionId"; + } else { + $resource = "database/$databaseId/grid/$context/$collectionId"; + } + $logs = $audit->getLogsByResource($resource, $queries); $output = [];