Skip to content

Commit

Permalink
#60 - flag disabled entities as deleted - do not care if disabled or …
Browse files Browse the repository at this point in the history
…private now
  • Loading branch information
Gummibeer committed Apr 19, 2021
1 parent fe8b02e commit 0a2c7c6
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions app/Jobs/GithubJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,12 @@ public function handle(): ?bool

if (
$exception->hasResponse()
&& $exception->getResponse()->getStatusCode() === Response::HTTP_NOT_FOUND
&& in_array($exception->getResponse()->getStatusCode(), [Response::HTTP_NOT_FOUND, Response::HTTP_FORBIDDEN])
) {
if (property_exists($this, 'user')) {
$this->user->update([
'block_reason' => BlockReason::DELETED(),
'blocked_at' => now(),
]);
}

if (property_exists($this, 'repository')) {
$this->repository->update([
'block_reason' => BlockReason::DELETED(),
'blocked_at' => now(),
]);
}

if (property_exists($this, 'organization')) {
$this->organization->update([
'block_reason' => BlockReason::DELETED(),
'blocked_at' => now(),
]);
}
$this->entity()->update([
'block_reason' => BlockReason::DELETED(),
'blocked_at' => now(),
]);

$this->delete();
}
Expand Down

0 comments on commit 0a2c7c6

Please sign in to comment.