Skip to content

Commit

Permalink
[CHAT-2445] Add hardDelete option to truncate channel (#805)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vova Maksimchuk committed Nov 23, 2021
1 parent aaa5bca commit 8c7a32f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,13 +608,13 @@ export class Channel<

/**
* truncate - Removes all messages from the channel
*
* @param {boolean} [options.hard_delete] Defines if messages of the channel must be hard deleted
* @return {Promise<TruncateChannelAPIResponse<ChannelType, CommandType, UserType>>} The server response
*/
async truncate() {
async truncate(options: { hard_delete?: boolean } = {}) {
return await this.getClient().post<
TruncateChannelAPIResponse<ChannelType, CommandType, UserType>
>(this._channelURL() + '/truncate', {});
>(this._channelURL() + '/truncate', options);
}

/**
Expand Down

0 comments on commit 8c7a32f

Please sign in to comment.