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

//post request api but data will go with url, not in req body;

exports.bookTicketRequest = async (trimmedBlockedTicketId) => {
  try {
    // console.log("trimmedBlockedTicketId:",trimmedBlockedTicketId)
    
    const apiEndPoint = `/bookticket?blockKey=${trimmedBlockedTicketId}`;
    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, {}, {});
    //console.log(response);

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

