Skip to content

Commit

Permalink
Added timeout parameter to userMute client method
Browse files Browse the repository at this point in the history
  • Loading branch information
gumuz committed Jul 17, 2020
1 parent 0a21bf1 commit 6f44677
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1164,13 +1164,17 @@ export class StreamChat {
/** muteUser - mutes a user
*
* @param targetID
* @param [userID] Only used with serverside auth
* @param options
* @returns {Promise<*>}
*/
async muteUser(targetID, userID = null) {
async muteUser(targetID, options) {
// WARNING: this is a backwards incompatible change
const userID = options ? options.userID : undefined;
const timeout = options ? options.timeout : undefined;
return await this.post(this.baseURL + '/moderation/mute', {
target_id: targetID,
...(userID ? { user_id: userID } : {}),
...(timeout ? { timeout } : {}),
});
}

Expand Down
2 changes: 1 addition & 1 deletion types/stream-chat/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export class StreamChat {
banUser(targetUserID: string, options: object): Promise<BanUserAPIResponse>;
unbanUser(targetUserID: string, options: object): Promise<UnbanUserAPIResponse>;

muteUser(targetUserID: string): Promise<MuteAPIResponse>;
muteUser(targetUserID: string, options?: object): Promise<MuteAPIResponse>;
unmuteUser(targetUserID: string): Promise<UnmuteAPIResponse>;

flagUser(userID: string, options?: object): Promise<FlagAPIResponse>;
Expand Down

0 comments on commit 6f44677

Please sign in to comment.