Skip to content

Commit

Permalink
Fixed an issue where the discussion list API was not cleared after ad…
Browse files Browse the repository at this point in the history
…ding a new post
  • Loading branch information
rafaucau committed Nov 27, 2021
1 parent abf2490 commit bdcbc86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Middleware/LSCachePurgeMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
}

if ($isPost) {
// When a new post is added
$discussionId = Arr::get($body, 'data.relationships.discussion.data.id');

if (!$discussionId) {
Expand All @@ -82,6 +81,9 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
if ($postId) {
$discussionId = Post::find($postId)->discussion_id;
}
} else {
// When a new post is added
array_push($purgeParams, 'tag=discussions.index');
}

if ($discussionId) {
Expand Down

0 comments on commit bdcbc86

Please sign in to comment.