From aab780476e17c9ed2fc3a12243cd05e560c21017 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 13 Jan 2026 11:20:06 +0200 Subject: [PATCH] fix projects filters --- .../Platform/Modules/Projects/Http/Projects/XList.php | 4 +--- src/Appwrite/Utopia/Response/Filters/ListSelection.php | 9 ++++----- .../e2e/Services/Projects/ProjectsConsoleClientTest.php | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php index 7269582a15..3a17d62ff4 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php @@ -170,9 +170,7 @@ class XList extends Action $selectedAttributes = []; foreach ($selectQueries as $query) { - foreach ($query->getValues() as $value) { - $selectedAttributes[] = $value; - } + $selectedAttributes[] = $query->getAttribute(); } if (\in_array('*', $selectedAttributes)) { diff --git a/src/Appwrite/Utopia/Response/Filters/ListSelection.php b/src/Appwrite/Utopia/Response/Filters/ListSelection.php index 53c5ae75cf..8c455a1022 100644 --- a/src/Appwrite/Utopia/Response/Filters/ListSelection.php +++ b/src/Appwrite/Utopia/Response/Filters/ListSelection.php @@ -20,12 +20,11 @@ class ListSelection extends Filter $selections = []; foreach ($this->selectQueries as $query) { - foreach ($query->getValues() as $value) { - if ($value === '*') { - return $content; - } - $selections[$value] = true; + if ($query->getAttribute() === '*') { + return $content; } + + $selections[$query->getAttribute()] = true; } return $this->handleList($content, $this->itemsKey, function (array $item) use ($selections) { diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 09d5ba2cf3..5bda912eaa 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -481,7 +481,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']); $this->assertGreaterThan(0, count($response['body']['projects'])); - +var_dump($response); $project = $response['body']['projects'][0]; $this->assertArrayHasKey('$id', $project); $this->assertArrayHasKey('name', $project);