const apiUtils = require('../utils/apiUtils');

exports.cancelTicketRequest = async (cancelTicketData) => {
  try {
    // console.log("trimmedBlockTicketId:",trimmedBlockTicketId)
    console.log("body string conversion", cancelTicketData);
    const req_body = JSON.stringify(cancelTicketData);
    const apiEndPoint = "/cancelticket";
    const method = "post";
    // console.log("req_body:", req_body);
    // console.log("method:", method);
    
    console.log("sending request for apicall");
    const response = await apiUtils.autherisedApiCall(apiEndPoint, method, {}, req_body);


    return response.data;
  } catch (error) {
    // console.error('Error in cancelling ticket:', error.response ? error.response : error.message);
    // throw new Error('Failed to cancel ticket');
    throw error;
  }
};

