strapi-plugin-tagsinput icon indicating copy to clipboard operation
strapi-plugin-tagsinput copied to clipboard

Filter by tag name

Open julia-fix opened this issue 1 year ago • 1 comments

Trying to get posts by tag name with this code:

filters: {
  tags: {
    name: {
      $eqi: decodedTag,
    },
  },
},

but it returns all records, tried $containsi also but no difference. I checked tags structure in records, it is like [{name: string}] or null.

julia-fix avatar Jul 17 '24 12:07 julia-fix

Ok I got the solution, it seems like we have to deal with stringified value:

filters: {
  tags: {
    $containsi: '"' + decodedTag + '"',
  },
},

Would be nice to mention it in the docs.

julia-fix avatar Jul 17 '24 14:07 julia-fix

@julia-fix You are trying to fetch posts, which is not related to this plugin, This is only for getting suggestions from all the tag's names.

cp-sumi-k avatar Sep 11 '24 10:09 cp-sumi-k