* Flag a user for moderation * @link https://getstream.io/activity-feeds/docs/node/moderation/?language=js#flagging-users * @method flagUser * @memberof StreamClient.prototype * @param {string} targetUserId - ID of the user to flag * @param {FlagUserOptions} [options] - Optional flagg
(targetUserId: string, options: FlagUserOptions = {})
| 1089 | * @example client.flagUser('bad-actor-456', { reason: 'inappropriate_content' }) |
| 1090 | */ |
| 1091 | flagUser(targetUserId: string, options: FlagUserOptions = {}) { |
| 1092 | this._throwMissingApiSecret(); |
| 1093 | |
| 1094 | return this.post<FlagAPIResponse>({ |
| 1095 | url: 'moderation/flag', |
| 1096 | body: { |
| 1097 | entity_type: 'stream:user', |
| 1098 | entity_id: targetUserId, |
| 1099 | user_id: options.user_id, |
| 1100 | reason: options.reason, |
| 1101 | }, |
| 1102 | token: this.getOrCreateToken(), |
| 1103 | }); |
| 1104 | } |
| 1105 | } |
no test coverage detected