mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
adding region query to deleteProjectsByTeam
This commit is contained in:
@@ -192,14 +192,6 @@ App::init()
|
||||
$route = $utopia->getRoute();
|
||||
|
||||
if ($project->isEmpty()) {
|
||||
|
||||
var_dump([
|
||||
'location' => 'api.php',
|
||||
'projectId' => !empty($project->getId()) ? $project->getId() : 'NA',
|
||||
'params' => 'Method: ' . $route->getMethod(). ' URL: ' . $route->getPath(),
|
||||
'_APP_REGION' => System::getEnv('_APP_REGION'),
|
||||
]);
|
||||
|
||||
throw new Exception(Exception::PROJECT_NOT_FOUND);
|
||||
}
|
||||
|
||||
|
||||
@@ -481,7 +481,7 @@ class Deletes extends Action
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @param Database $dbForPlatform
|
||||
* @param Document $document
|
||||
* @return void
|
||||
@@ -492,11 +492,13 @@ class Deletes extends Action
|
||||
* @throws Structure
|
||||
* @throws Exception
|
||||
*/
|
||||
private function deleteProjectsByTeam(Database $dbForPlatform, callable $getProjectDB, CertificatesAdapter $certificates, Document $document): void
|
||||
protected function deleteProjectsByTeam(Database $dbForPlatform, callable $getProjectDB, CertificatesAdapter $certificates, Document $document): void
|
||||
{
|
||||
|
||||
$projects = $dbForPlatform->find('projects', [
|
||||
Query::equal('teamInternalId', [$document->getInternalId()])
|
||||
Query::equal('teamInternalId', [$document->getInternalId(),
|
||||
Query::equal('region', System::getEnv('_APP_REGION', 'default'))
|
||||
])
|
||||
]);
|
||||
|
||||
foreach ($projects as $project) {
|
||||
|
||||
Reference in New Issue
Block a user