confirmRefundRequest method

void confirmRefundRequest(
  1. BookingHistory history
)

Implementation

void confirmRefundRequest(BookingHistory history) async {
  try {
    var response = await Requests.getDio().patch(
      "booking/v4/${history.id}/cancellation/confirm",
    );

    if (response.statusCode == 200) {
      CustomFlashWidget.showFlashMessage(
        type: FlashType.success,
        title: "Success",
        message: "Booking cancellation request was sent",
      );
      refreshBooking();
    } else {
      debugPrint("error ${response.data}");
      CustomFlashWidget.showFlashMessage(
          title: "Error",
          message: response.data["message"] ?? 'Error cancelling this booking',
          type: FlashType.error);
    }
  } catch (e) {
    debugPrint("error ${e.toString()}");

    CustomFlashWidget.showFlashMessage(
        title: "Error",
        message: 'Error cancelling this booking',
        type: FlashType.error);
  }
}