From efab551fdba60c4079ecf8847ae4661733a8f912 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Wed, 21 Jul 2021 15:22:36 +0530 Subject: [PATCH] fix(llc): channel.stopWatching Signed-off-by: xsahil03x --- packages/stream_chat/lib/src/core/api/channel_api.dart | 1 + packages/stream_chat/test/src/core/api/channel_api_test.dart | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat/lib/src/core/api/channel_api.dart b/packages/stream_chat/lib/src/core/api/channel_api.dart index 68f6c4f8..1ba7f333 100644 --- a/packages/stream_chat/lib/src/core/api/channel_api.dart +++ b/packages/stream_chat/lib/src/core/api/channel_api.dart @@ -289,6 +289,7 @@ class ChannelApi { ) async { final response = await _client.post( '${_getChannelUrl(channelId, channelType)}/stop-watching', + data: {}, ); return EmptyResponse.fromJson(response.data); } diff --git a/packages/stream_chat/test/src/core/api/channel_api_test.dart b/packages/stream_chat/test/src/core/api/channel_api_test.dart index ab530ff1..c43f161f 100644 --- a/packages/stream_chat/test/src/core/api/channel_api_test.dart +++ b/packages/stream_chat/test/src/core/api/channel_api_test.dart @@ -595,14 +595,14 @@ void main() { final path = '${_getChannelUrl(channelId, channelType)}/stop-watching'; - when(() => client.post(path)).thenAnswer( + when(() => client.post(path, data: {})).thenAnswer( (_) async => successResponse(path, data: {})); final res = await channelApi.stopWatching(channelId, channelType); expect(res, isNotNull); - verify(() => client.post(path)).called(1); + verify(() => client.post(path, data: {})).called(1); verifyNoMoreInteractions(client); }); }