From ccae13ac19ca1162044a80774de7d332800eb445 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 15 Sep 2021 10:39:49 +0545 Subject: [PATCH] fix bucket delete --- app/controllers/api/storage.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)) ;