Skip to content

How to get names of appliedTags? #1353

Answered by itsMattShull
itsMattShull asked this question in Q&A
Discussion options

You must be logged in to vote

Figured it out:

        const tag = parent.availableTags.filter((item) => { return item.name == 'Tag Name' }) // gets a list of all available tags for forum channel and filters to the one you're looking for
        const tagID = tag[0].id // get the ID of the tag you want to add
        let postTags = channel.appliedTags // get a list of existing tags on post
        postTags.push(tagID) // add the new tag to the array
        channel.setAppliedTags(postTags) // set the applied tags on the post

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by itsMattShull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #1352 on November 15, 2022 04:56.