[LLC -> Channel] Segregate sendMessage api call and state handling

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-02-17 20:13:20 +05:30
parent 1a6a06a25f
commit 517c7e489d
2 changed files with 13 additions and 12 deletions
+10
View File
@@ -1246,6 +1246,16 @@ class StreamChatClient {
return decode(response.data, EmptyResponse.fromJson);
}
/// Sends the message to the given channel
Future<SendMessageResponse> sendMessage(
Message message, String channelId, String channelType) async {
final response = await post(
'/channels/$channelType/$channelId/message',
data: {'message': message},
);
return decode(response.data, SendMessageResponse.fromJson);
}
/// Update the given message
Future<UpdateMessageResponse> updateMessage(Message message) async {
final response = await post(