From ad79f3dcca84a13a828e89dea00fdc22653841e1 Mon Sep 17 00:00:00 2001 From: Darshan Date: Fri, 8 Aug 2025 13:34:33 +0530 Subject: [PATCH] fix: wrong resource path. --- .../Http/Databases/Collections/Documents/Logs/XList.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 = [];