getTransferTicket function

Future<TicketTransferResponse> getTransferTicket(
  1. {required int ticketId,
  2. required int bookingId,
  3. required int transferUserId}
)

Reminder : Booking response Model

Implementation

Future<TicketTransferResponse> getTransferTicket({required int ticketId, required int bookingId, required int transferUserId}) async {
  appStore.setLoading(true);

  Map req = {
    BookingKeys.ticketId: ticketId,
    BookingKeys.bookingId: bookingId,
    BookingKeys.userId: appStore.userId,
    BookingKeys.transferTo: transferUserId,
  };
  try {
    TicketTransferResponse res = TicketTransferResponse.fromMap(await (handleResponse(await buildHttpResponse(APIEndPoint.transferTicket, request: req, method: HttpMethod.POST))));
    appStore.setLoading(false);
    return res;
  } catch (e) {
    appStore.setLoading(false);
    throw errorSomethingWentWrong;
  }
}