Skip to content

Commit

Permalink
The negate field doesn't get used, which means you cant exclude tags (#…
Browse files Browse the repository at this point in the history
…3713)

e.g. This allows you to

`/api/posts?sort=-createdAt&filter[tag]=14` to include tag 14 and `/api/posts?sort=-createdAt&filter[tag]=-14` to exclude tag 14
  • Loading branch information
OwenMelbz authored Jan 17, 2023
1 parent 03d2d7e commit 4bb3b22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/tags/src/Filter/PostTagFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public function filter(FilterState $filterState, string $filterValue, bool $nega
{
$filterState->getQuery()
->join('discussion_tag', 'discussion_tag.discussion_id', '=', 'posts.discussion_id')
->where('discussion_tag.tag_id', $filterValue);
->where('discussion_tag.tag_id', $negate ? '!=' : '=', $filterValue);
}
}

0 comments on commit 4bb3b22

Please sign in to comment.