Skip to content

Commit

Permalink
chore refactor: better code
Browse files Browse the repository at this point in the history
  • Loading branch information
didoda committed Jun 27, 2024
1 parent fd084ec commit 023c0dd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Controller/TrashController.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,9 @@ public function deleteData(string $id): void
foreach ($streams as $stream) {
$search = $this->apiClient->get('/streams', ['filter' => ['uuid' => $stream['id']]]);
$count = (int)Hash::get($search, 'meta.pagination.count', 0);
if ($count === 0) {
continue;
if ($count === 1) {
$this->apiClient->delete(sprintf('/streams/%s', $stream['id']));
}
$this->apiClient->delete(sprintf('/streams/%s', $stream['id']));
}
}
}

0 comments on commit 023c0dd

Please sign in to comment.