Skip to content

Commit

Permalink
fix: add block term request
Browse files Browse the repository at this point in the history
- use postAsJson function
- moderator and broadcasterIDs are query parameters
  • Loading branch information
jackmcguire1 committed Jan 3, 2024
1 parent 950d0eb commit 7102c68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions moderation.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ func (c *Client) GetBlockedTerms(params *BlockedTermsParams) (*BlockedTermsRespo
}

type AddBlockedTermParams struct {
BroadcasterID string `json:"broadcaster_id"`
ModeratorID string `json:"moderator_id"`
BroadcasterID string `query:"broadcaster_id"`
ModeratorID string `query:"moderator_id"`
Text string `json:"text"`
}

Expand All @@ -189,7 +189,7 @@ func (c *Client) AddBlockedTerm(params *AddBlockedTermParams) (*AddBlockedTermRe
return nil, errors.New("the term len must be between 2 and 500")
}

resp, err := c.post("/moderation/blocked_terms", &ManyAddBlockedTerms{}, params)
resp, err := c.postAsJSON("/moderation/blocked_terms", &ManyAddBlockedTerms{}, params)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 7102c68

Please sign in to comment.