This commit is contained in:
Malini 2025-12-19 12:23:47 +05:30
parent e488062aed
commit 89e2bd3785

View File

@ -84,7 +84,68 @@ export const getQuarterPeriods = async (currentYear, currentQuarter) => {
} }
}; };
export const getPreviousForecastData = async ( // export const getPreviousForecastData = async (
// establishmentId,
// quarter,
// year,
// productId
// ) => {
// try {
// const response = await getRequest(
// "/submissions/getPreviousForecastData",
// {
// params: {
// establishment_id: establishmentId,
// quarter,
// year,
// product_id: productId,
// },
// }
// );
// // Always return only backend data
// return response?.data || null;
// } catch (error) {
// console.error("Error fetching previous forecast data:", error);
// return null;
// }
// };
// export const getBeforePreviousData = async (
// establishmentId,
// quarter,
// year,
// productId
// ) => {
// try {
// if (!establishmentId || !quarter || !year || !productId) {
// throw new Error("Missing required parameters");
// }
// const response = await getRequest(
// "/submissions/getBeforePreviousData",
// {
// params: {
// establishment_id: establishmentId,
// current_quarter: quarter,
// current_year: year,
// product_id: productId,
// },
// }
// );
// return response?.data ?? null;
// } catch (error) {
// console.error("Error fetching data:", error);
// return null;
// }
// };
export const getPreviousForecastData = async (
establishmentId, establishmentId,
quarter, quarter,
year, year,
@ -129,8 +190,8 @@ export const getBeforePreviousData = async (
{ {
params: { params: {
establishment_id: establishmentId, establishment_id: establishmentId,
current_quarter: quarter, current_quarter: quarter,
current_year: year, current_year: year,
product_id: productId, product_id: productId,
}, },
} }
@ -145,9 +206,6 @@ export const getBeforePreviousData = async (
}; };
export const getSubmissionHistoryByEstablishment = async (establishmentId, config = {}) => { export const getSubmissionHistoryByEstablishment = async (establishmentId, config = {}) => {
try { try {
if (!establishmentId) { if (!establishmentId) {