// reportBaseUrlAddAPI.js
import apiService from '../APIRequestService/APIServices';

// Function to handle the Add API request
export const addReport = async (formData) => {
  try {
    const response = await apiService.post('/Rpt_builder2/Rpt_builder2', formData);
    
    console.log("add Report response: ",response)
    return response; // Return the response to handle success in the component
  } catch (error) {
    throw error; // Re-throw error to handle it in the calling component
  }
};

// Function to fetch keys from URL
export const getKeysFromUrl = async (url) => {
  try {
    const response = await apiService.get(`/api/report-builder/columns`, { url });
    return response; // Return the response for further processing
  } catch (error) {
    throw error; // Re-throw error to handle it in the calling component
  }
};
