Query keys by resourceInternalId/resourceType, not projectInternalId

projectInternalId is a written-but-not-queryable legacy column on the
keys collection (upstream filter uses resourceInternalId + resourceType).
Mirror that here so the duplicate-check find() doesn't error out.
This commit is contained in:
Prem Palanisamy committed 2026-05-14 14:14:25 +01:00
1 parent 59479d04d2
commit f4718e26cb
1 file changed
+2 -1
+2 -1
View File
@@ -3135,7 +3135,8 @@ class Appwrite extends Destination
protected function createApiKey(ApiKey $resource): bool
{
$existing = $this->dbForPlatform->findOne('keys', [
Query::equal('projectInternalId', [$this->projectInternalId]),
Query::equal('resourceType', ['projects']),
Query::equal('resourceInternalId', [$this->projectInternalId]),
Query::equal('name', [$resource->getApiKeyName()]),
]);