diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 879df731c9..6a9e0e01c0 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -442,15 +442,15 @@ App::delete('/v1/storage/buckets/:bucketId') throw new Exception('Bucket not found', 404); } + if(!$dbForInternal->deleteDocument('buckets', $bucketId)) { + throw new Exception('Failed to remove project from DB', 500); + } + $deletes ->setParam('type', DELETE_TYPE_DOCUMENT) ->setParam('document', $bucket) ; - if(!$dbForInternal->deleteDocument('buckets', $bucketId)) { - throw new Exception('Failed to remove project from DB', 500); - } - $events ->setParam('eventData', $response->output($bucket, Response::MODEL_BUCKET)) ;