The negate field doesn't get used, which means you cant exclude tags (#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
This commit is contained in:
Owen Melbourne 2023-01-17 19:47:28 +00:00 committed by GitHub
parent 03d2d7eabb
commit 4bb3b2235d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,6 @@ class PostTagFilter implements FilterInterface
{
$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);
}
}