Merge pull request #9099 from appwrite/fix-usage-payload-bug

Fix usage payload bug
This commit is contained in:
Christy Jacob 2024-12-12 20:58:12 +04:00 committed by GitHub
commit ef150ac2c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,7 +59,13 @@ class Usage extends Action
throw new Exception('Missing payload');
}
$project = new Document($payload['project'] ?? []);
$document = $payload['project'] ?? [];
if (empty($document)) {
var_dump($payload);
}
$project = new Document($document);
$projectId = $project->getInternalId();
foreach ($payload['reduce'] ?? [] as $document) {
if (empty($document)) {