closeConversation method

Future<void> closeConversation(
  1. String conversationUid
)

Implementation

Future<void> closeConversation(String conversationUid) async {
  try {
    final response = await _conversationRepository.closeConversation(
        CloseConversationRequest(conversationUid: conversationUid));

    if (response.status == 'success') {
      //log(response.toString());
      getAllConversations();
      _loadingService.showInfo('conversation closed');
      update();
    }
  } catch (e) {
    if (e is DioError) {
      _loadingService.showError(e.response?.data['message'] ??
          'Error: Unable to close conversation');
    } else {
      _loadingService.showError(
        'Error: unable to close conversation...',
      );
    }
    //log(e.toString());
  }
}