MCPcopy Create free account
hub / github.com/GetStream/stream-js / update

Method update

src/reaction.ts:269–288  ·  view source on GitHub ↗

* 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 = {},
  )

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

putMethod · 0.80
buildURLMethod · 0.80

Tested by

no test coverage detected