Skip to content

Commit

Permalink
fix: delete post forever warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaucau committed Nov 28, 2023
1 parent ae4ddbc commit 20d505c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Compatibility/FlarumTags/FlarumTagsPurgeMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ protected function processPurge(
$discussionId = Arr::get($payload, 'data.relationships.discussion.data.id');
if (! $discussionId) {
$postId = Arr::get($payload, 'data.id');
if (! $postId) {
return $response;
}

$discussionId = Post::find($postId)->discussion_id;
}
}

if (! $discussionId) {
return $response;
}

$discussion = Discussion::find($discussionId);
if (! $discussion) {
return $response;
Expand Down

0 comments on commit 20d505c

Please sign in to comment.