* update reaction * @link https://getstream.io/activity-feeds/docs/node/reactions_introduction/?language=js#updating-reactions * @method update * @memberof StreamReaction.prototype * @param {string} id Reaction Id * @param {ReactionType | ChildReactionType} data Data associated
(
id: string,
data?: StreamFeedGenerics['reactionType'] | StreamFeedGenerics['childReactionType'],
{ targetFeeds = [], targetFeedsExtraData }: ReactionUpdateOptions = {},
)
| 267 | * @example reactions.update("67b3e3b5-b201-4697-96ac-482eb14f88ec", "0c7db91c-67f9-11e8-bcd9-fe00a9219401", "comment", {"text": "love it!"},) |
| 268 | */ |
| 269 | update( |
| 270 | id: string, |
| 271 | data?: StreamFeedGenerics['reactionType'] | StreamFeedGenerics['childReactionType'], |
| 272 | { targetFeeds = [], targetFeedsExtraData }: ReactionUpdateOptions = {}, |
| 273 | ) { |
| 274 | const body: ReactionBody<StreamFeedGenerics['reactionType'] | StreamFeedGenerics['childReactionType']> = { |
| 275 | data, |
| 276 | target_feeds: this._convertTargetFeeds(targetFeeds), |
| 277 | }; |
| 278 | if (targetFeedsExtraData != null) { |
| 279 | body.target_feeds_extra_data = targetFeedsExtraData; |
| 280 | } |
| 281 | return this.client.put< |
| 282 | ReactionAPIResponse<StreamFeedGenerics['reactionType'] | StreamFeedGenerics['childReactionType']> |
| 283 | >({ |
| 284 | url: this.buildURL(id), |
| 285 | body, |
| 286 | token: this.token, |
| 287 | }); |
| 288 | } |
| 289 | |
| 290 | /** |
| 291 | * delete reaction |