1
0
Fork 0
mirror of synced 2024-07-04 06:00:53 +12:00

Merge remote-tracking branch 'origin/1.3.x' into fix-nested-id-required

This commit is contained in:
Jake Barnby 2023-04-14 21:59:42 +12:00
commit fb130f3aa2
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -4,6 +4,7 @@ namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
use Utopia\Database\Document;
class Team extends Model
{
@ -49,6 +50,24 @@ class Team extends Model
;
}
/**
* Process Document before returning it to the client
*
* @return Document
*/
public function filter(Document $document): Document
{
$prefs = $document->getAttribute('prefs');
if ($prefs instanceof Document) {
$prefs = $prefs->getArrayCopy();
}
if (is_array($prefs) && empty($prefs)) {
$document->setAttribute('prefs', new \stdClass());
}
return $document;
}
/**
* Get Name
*