1
0
Fork 0
mirror of synced 2024-08-31 09:51:33 +12:00

Fix bug on ZDT

This commit is contained in:
Matej Bačo 2024-02-06 16:08:42 +01:00
parent 3a5c233b59
commit a7e95588c6

View file

@ -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);