1
0
Fork 0
mirror of synced 2024-09-28 15:31:43 +12:00

Merge pull request #8624 from appwrite/fix-tenant-not-removed

Remove tenant in document filter
This commit is contained in:
Jake Barnby 2024-09-05 15:29:48 +12:00 committed by GitHub
commit f9992c2f64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 40 additions and 38 deletions

View file

@ -72,7 +72,8 @@ class Document extends Any
public function filter(DatabaseDocument $document): DatabaseDocument
{
$document->removeAttribute('$internalId');
$document->removeAttribute('$collection'); // $collection is the internal collection ID
$document->removeAttribute('$collection');
$document->removeAttribute('$tenant');
foreach ($document->getAttributes() as $attribute) {
if (\is_array($attribute)) {

View file

@ -1593,6 +1593,7 @@ trait DatabasesBase
$this->assertEquals($response['body']['$permissions'], $document['$permissions']);
$this->assertEquals($response['body']['birthDay'], $document['birthDay']);
$this->assertFalse(array_key_exists('$internalId', $response['body']));
$this->assertFalse(array_key_exists('$tenant', $response['body']));
}
}