feat(llc): add additional parameters to channel.truncate
This commit is contained in:
@@ -265,10 +265,18 @@ class ChannelApi {
|
||||
/// Removes all messages from the channel
|
||||
Future<EmptyResponse> truncateChannel(
|
||||
String channelId,
|
||||
String channelType,
|
||||
) async {
|
||||
String channelType, {
|
||||
Message? message,
|
||||
bool? skipPush,
|
||||
DateTime? truncatedAt,
|
||||
}) async {
|
||||
final response = await _client.post(
|
||||
'${_getChannelUrl(channelId, channelType)}/truncate',
|
||||
data: {
|
||||
if (message != null) 'message': message,
|
||||
if (skipPush != null) 'skip_push': skipPush,
|
||||
if (truncatedAt != null) 'truncated_at': truncatedAt,
|
||||
},
|
||||
);
|
||||
return EmptyResponse.fromJson(response.data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user