deleteWhatsapp method

Future<void> deleteWhatsapp(
  1. String whatsappUid
)

Handles whatsapp account deletion from bodsquare.

Implementation

Future<void> deleteWhatsapp(String whatsappUid) async {
  final DeleteSocialMediaResponse response;
  try {
    getConnectionUrlLoadingStatus.value = true;
    response = await _linkingRepository.deleteWhatsappConnection(whatsappUid);
    if (response.status == 'success') {
      await getSocialMediaAccounts();
      getConnectionUrlLoadingStatus.value = false;
      linkingSuccess.value = response.message ?? 'Whatsapp account Removed';
      // _loadingService
      //     .showSuccess(response.message ?? 'Whatsapp account Removed');
    }
  } catch (e) {
    if (e is DioError) {
      getConnectionUrlLoadingStatus.value = false;
      linkingError.value = "Error: Unable to remove Whatsapp account";
      // _loadingService.showError("Error:
      //Unable to remove Whatsapp account");
    } else {
      getConnectionUrlLoadingStatus.value = false;
      linkingError.value = "Error: Unable to remove Whatsapp account";
      // _loadingService.showError("Error: Unable to remove
      // Whatsapp account");
    }
  }
}