From a7e95588c6631c298782f51e920e1f8f75191b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 6 Feb 2024 16:08:42 +0100 Subject: [PATCH] Fix bug on ZDT --- app/controllers/api/projects.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 0f7fad564d..d218750a50 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -185,12 +185,6 @@ App::post('/v1/projects') /** @var array $collections */ $collections = Config::getParam('collections', [])['projects'] ?? []; - // Allow Cloud overrides (useful for ZDT migration) - $collectiosOverride = $hooks->trigger('getProjectCollections'); - if (!empty($collectiosOverride)) { - $collections = $collectiosOverride; - } - foreach ($collections as $key => $collection) { if (($collection['$collection'] ?? '') !== Database::METADATA) { continue; @@ -225,6 +219,8 @@ App::post('/v1/projects') $dbForProject->createCollection($key, $attributes, $indexes); } + $hooks->trigger('afterProjectCreated'); // Useful for ZDT to mirror the project to destination + $response ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($project, Response::MODEL_PROJECT);