From 034a01af105f6228be9ac98dad397fc494e03e6d Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 12 Jun 2021 13:07:26 +0300 Subject: [PATCH] Updated deletes worker --- app/workers/deletes.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/workers/deletes.php b/app/workers/deletes.php index 5316783c49..1ca7532e62 100644 --- a/app/workers/deletes.php +++ b/app/workers/deletes.php @@ -32,14 +32,15 @@ class DeletesV1 public function perform() { - $projectId = isset($this->args['projectId']) ? $this->args['projectId'] : ''; - $type = $this->args['type']; + $projectId = $this->args['projectId'] ?? ''; + $type = $this->args['type'] ?? ''; switch (strval($type)) { case DELETE_TYPE_DOCUMENT: - $document = $this->args['document']; + $document = $this->args['document'] ?? ''; $document = new Document($document); - switch (strval($document->getCollection())) { + + switch ($document->getCollection()) { case Database::SYSTEM_COLLECTION_PROJECTS: $this->deleteProject($document); break; @@ -78,7 +79,6 @@ class DeletesV1 default: Console::error('No delete operation for type: '.$type); break; - } }